Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

feat: Add --slice-type-suffix option #25

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
run:
skip-files:
- cmd/sandbox/main.go
- internal/integrationtest/samples/.*\.go
modules-download-mode: readonly
allow-parallel-runners: true

# https://golangci-lint.run/usage/linters/
linters:
enable-all: true
disable:
- deadcode # deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
- depguard # unnecessary
- dupl # disable to avoid encouraging excessive DRY
- dupl # too many unnecessary detections
- exhaustruct # https://github.com/GaijinEntertainment/go-exhaustruct
- exhaustivestruct # https://github.com/mbilski/exhaustivestruct
- gci # unnecessary
- goconst # unnecessary
- godox # unnecessary
- golint # deprecated https://github.com/golang/lint
- gomnd # https://github.com/tommy-muehle/go-mnd
- gosmopolitan # unnecessary
- gomnd # deprecated https://github.com/tommy-muehle/go-mnd
- ifshort # for readability
- interfacebloat # unnecessary
- interfacer # deprecated https://github.com/mvdan/interfacer
- interfacebloat # unnecessary
- lll # unnecessary
- maligned # deprecated https://github.com/mdempsky/maligned
- nlreturn # ignore "return with no blank line before"
- nolintlint # unnecessary
- nonamedreturns # unnecessary
- nosnakecase # for environment variable key
- scopelint # deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner. Replaced by exportloopref.
- structcheck # deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
- varcheck # deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused.
- varnamelen # unnecessary
- wsl # ignore "declarations should never be cuddled"

Expand All @@ -42,7 +43,6 @@ linters-settings:
- func fmt.Errorf(format string, a ...interface{}) error
- func github.com/kunitsucom/util.go/errors.Errorf(format string, a ...interface{}) error


issues:
exclude-rules:
- path: _test\.go
Expand All @@ -54,9 +54,13 @@ issues:
- gochecknoglobals
- gocognit
- goconst
- gocyclo
- goerr113
- gosec
- ireturn
- maintidx
- noctx
- revive
- testpackage
- varnamelen
- wrapcheck
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,25 @@ versenv:
githooks:
@[[ -f "${PRE_PUSH}" ]] || cp -ai "${REPO_ROOT}/.githooks/pre-push" "${PRE_PUSH}"

clean: ## Clean up chace, etc
clean: ## Clean up cache, etc
go clean -x -cache -testcache -modcache -fuzzcache
golangci-lint cache clean

.PHONY: lint
lint: ## Run secretlint, go mod tidy, golangci-lint
# ref. https://github.com/secretlint/secretlint
docker run -v `pwd`:`pwd` -w `pwd` --rm secretlint/secretlint secretlint "**/*"
# tidy
go mod tidy
git diff --exit-code go.mod go.sum
# lint
# ref. https://golangci-lint.run/usage/linters/
golangci-lint run --fix --sort-results
git diff --exit-code
# gitleaks ref. https://github.com/gitleaks/gitleaks
@if ! command -v gitleaks >/dev/null 2>&1; then \
printf "\033[31;1m%s\033[0m\n" "gitleaks is not installed: brew install gitleaks" 1>&2; \
exit 1; \
fi
gitleaks detect --source . -v

.PHONY: credits
credits: ## Generate CREDITS file
Expand Down
Loading
Loading