Skip to content

Commit 35469b1

Browse files
committed
feat: initial commit
0 parents  commit 35469b1

34 files changed

+1774
-0
lines changed

.github/workflows/ci.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
name: CI
7+
jobs:
8+
test:
9+
name: Test
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
- name: Init Hermit
15+
run: ./bin/hermit env -r >> $GITHUB_ENV
16+
- name: E2E Test
17+
run: e2e-test
18+
lint:
19+
name: Lint
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v3
24+
- name: Init Hermit
25+
run: ./bin/hermit env -r >> $GITHUB_ENV
26+
- name: golangci-lint
27+
run: golangci-lint run

.github/workflows/release.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
jobs:
7+
release:
8+
name: Release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
- run: ./bin/hermit env --raw >> $GITHUB_ENV
15+
- run: goreleaser release
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.golangci.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
run:
2+
tests: true
3+
skip-dirs:
4+
- _examples
5+
6+
output:
7+
print-issued-lines: false
8+
9+
linters:
10+
enable-all: true
11+
disable:
12+
- maligned
13+
- megacheck
14+
- lll
15+
- gocyclo
16+
- dupl
17+
- gochecknoglobals
18+
- funlen
19+
- godox
20+
- wsl
21+
- goimports
22+
- gomnd
23+
- gocognit
24+
- goerr113
25+
- nolintlint
26+
- testpackage
27+
- godot
28+
- nestif
29+
- paralleltest
30+
- nlreturn
31+
- cyclop
32+
- exhaustivestruct
33+
- gci
34+
- gofumpt
35+
- errorlint
36+
- exhaustive
37+
- ifshort
38+
- wrapcheck
39+
- stylecheck
40+
- nonamedreturns
41+
- revive
42+
- dupword
43+
- exhaustruct
44+
- varnamelen
45+
- forcetypeassert
46+
- ireturn
47+
- maintidx
48+
- govet
49+
- nosnakecase
50+
- testableexamples
51+
- gochecknoinits
52+
- prealloc
53+
- forbidigo
54+
- goprintffuncname
55+
56+
linters-settings:
57+
govet:
58+
check-shadowing: true
59+
gocyclo:
60+
min-complexity: 10
61+
dupl:
62+
threshold: 100
63+
goconst:
64+
min-len: 8
65+
min-occurrences: 3
66+
forbidigo:
67+
#forbid:
68+
# - (Must)?NewLexer$
69+
exclude_godoc_examples: false
70+
71+
issues:
72+
max-per-linter: 0
73+
max-same: 0
74+
exclude-use-default: false
75+
exclude:
76+
# Captured by errcheck.
77+
- '^(G104|G204):'
78+
# Very commonly not checked.
79+
- 'Error return value of .(.*\.Help|.*\.MarkFlagRequired|(os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked'
80+
- 'exported method (.*\.MarshalJSON|.*\.UnmarshalJSON|.*\.EntityURN|.*\.GoString|.*\.Pos) should have comment or be unexported'
81+
- 'comment on exported method'
82+
- 'composite literal uses unkeyed fields'
83+
- 'declaration of "err" shadows declaration'
84+
- 'should not use dot imports'
85+
- 'Potential file inclusion via variable'
86+
- 'should have comment or be unexported'
87+
- 'comment on exported var .* should be of the form'
88+
- 'at least one file in a package should have a package comment'
89+
- 'string literal contains the Unicode'
90+
- 'methods on the same type should have the same receiver name'
91+
- '_TokenType_name should be _TokenTypeName'
92+
- '`_TokenType_map` should be `_TokenTypeMap`'
93+
- 'rewrite if-else to switch statement'
94+
- 'comment.*should be of the form'
95+
- 'should have comment'

.goreleaser.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
project_name: happy
2+
release:
3+
github:
4+
owner: thnxdev
5+
name: happy
6+
brews:
7+
-
8+
install: bin.install "happy"
9+
env:
10+
- CGO_ENABLED=0
11+
builds:
12+
- goos:
13+
- linux
14+
- darwin
15+
- windows
16+
goarch:
17+
- arm64
18+
- amd64
19+
- "386"
20+
goarm:
21+
- "6"
22+
dir: ./cmd/happy
23+
main: .
24+
ldflags: -s -w -X main.version={{.Version}}
25+
binary: happy
26+
archives:
27+
-
28+
format: tar.gz
29+
name_template: '{{ .Binary }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{
30+
.Arm }}{{ end }}'
31+
files:
32+
- COPYING
33+
- README*
34+
snapshot:
35+
name_template: SNAPSHOT-{{ .Commit }}
36+
checksum:
37+
name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt'

COPYING

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (C) 2023 thanks.dev
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7+
of the Software, and to permit persons to whom the Software is furnished to do
8+
so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

0 commit comments

Comments
 (0)