pre-commit 可以与 golangci-lint 集成,用于在每次提交代码前自动执行 Go 代码检查。 pre-commit 是一个流行的开源工具,用于在代码提交之前执行一系列检查和测试。通过集成 pre-commit 和 golangci-lint,可以在每次提交 Go 代码时自动运行静态代码检查,确保代码质量。 安装pre-commit 首先,确保系统上已经安装了 Py...
最近代码规范很烦人。要求一个函数不能超过80行。只能在git pre-commit钩子上检查下了。 这里使用golangci-lint,里面包含了funlen检查器 config.yaml
ci: update golangci-lint, pre-commit, use global makelib … 6a68aad TylerGillson requested a review from a team as a code owner June 27, 2024 19:49 TylerGillson requested a review from ahmad-ibra June 27, 2024 19:49 TylerGillson added 2 commits June 27, 2024 13:53 chore...
Golangci lint has had a major update which makes the old config invalid. I updated the config usinghttps://golangci-lint.run/product/migration-guide/, this also made the linters complain about some things which i then also adapted. Ive also noticed that after chaning the pre commit workfl...
我正在尝试使用 github 操作中与 golang 相关的一些挂钩运行 pre-commit.com 脚本。似乎测试环境缺少一些工具来执行 go-imports 和 golangci-lint。我已经在预提交步骤之前添加了在环境中设置所需工具的步骤,但这没有帮助。.pre-commit-config.yaml:repos:- repo: https://github.com/dnephin/pre-commit-go...
If one of your developers doesn’t have node installed but modifies a JavaScript file, pre-commit automatically handles downloading and building node to run eslint without root.Installation Before you can run hooks, you need to have the pre-commit package manager installed. Using pip: pip ...
make: golangci-lint: No such file or directory make: *** [check] Error 1 error: failed to push some refs to 'ssh://git.xxxxx.net/xxx/xxxxx-api.git' Do I have to tell GoLand to read the .zshrc file somehow? What could I check in the settings to make s...
if [[ "$STAGED_GO_FILES" = "" ]]; then exit 0 fi PASS=true for FILE in $STAGED_GO_FILES do goimports -w $FILE golangci-lint run --fix --disable=typecheck $FILE if [[ $? != 0 ]]; then PASS=false fi done if ! $PASS; then printf "COMMIT FAILED\n...
golang The hook repository must contain go source code. It will be installed viago install ./... pre-commit will create an isolatedGOPATHfor each hook and theentryshould match an executable which will get installed into theGOPATH'sbindirectory. This...
v0.0.3 Unverified Download v0.0.2 855fdc28· chore: update to latest Go version and golangci-lint · 1 year ago Release: v0.0.2 v0.0.2 Unverified Download v0.0.1 a424b2b2· feat: initial commit · 2 years ago Release: v0.0.1 v0.0.1 Unverified Download ...