diff --git a/.gitignore b/.gitignore index a923ef3..f81cc48 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,6 @@ experimenting ## CI assets .templates + +## Taskfile +.task diff --git a/.golangci.yml b/.golangci.yml index 54cda6a..6a68b00 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -53,7 +53,6 @@ linters: - inamedparam # reports interfaces with unnamed method parameters - interfacebloat # check for large interfaces - intrange # find places where for loops could make use of an integer range - - ireturn # Accept Interfaces, Return Concrete Types. - lll # check for long lines - maintidx # measures the maintainability index of each function - mirror # reports wrong mirror patterns of bytes/strings usage @@ -123,6 +122,7 @@ linters: - mnd # too many detections - cyclop # covered by gocyclo - gochecknoglobals # there are many valid reasons for global variables, depending on the project + - ireturn # there are too many exceptions linters-settings: wsl: @@ -139,6 +139,9 @@ linters-settings: line-length: 140 tab-width: 1 + nlreturn: + block-size: 2 + exhaustive: check-generated: false default-signifies-exhaustive: true diff --git a/Taskfile.yml b/Taskfile.yml new file mode 100644 index 0000000..4bca50d --- /dev/null +++ b/Taskfile.yml @@ -0,0 +1,31 @@ +# ┌───────────────────────────────────────────────────────────────────┐ +# │ │ +# │ IMPORTANT NOTE │ +# │ │ +# │ This file is synced with https://github.com/atomicgo/template │ +# │ │ +# │ Please apply all changes to the template repository │ +# │ │ +# └───────────────────────────────────────────────────────────────────┘ + +version: "3" + +tasks: + test: + desc: Run all tests + cmds: + - go test ./... + tdd: + desc: Test Driven Development - Watch tests + watch: true + sources: + - "**/*.go" + cmds: + - go test ./... + + lint: + desc: Run all linters + cmds: + - go mod tidy + - wsl --allow-cuddle-declarations --force-err-cuddling --force-case-trailing-whitespace 3 --fix ./... + - golangci-lint run