Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add golang lint #3154

Merged
merged 22 commits into from
Sep 7, 2023
Merged

add golang lint #3154

merged 22 commits into from
Sep 7, 2023

Conversation

changluyi
Copy link
Collaborator

@changluyi changluyi commented Aug 21, 2023

What type of this PR

Examples of user facing changes:

  • Features
  • Bug fixes
  • Docs
  • Tests

Which issue(s) this PR fixes:

Fixes #(issue-number)

WHAT

🤖 Generated by Copilot at ec95eea

Improved the linting workflow and configuration for the project. Added a .github/workflows/.golangci.yml file to customize the golangci-lint tool and modified the .github/workflows/lint.yaml file to use the new configuration and filter the relevant files.

🤖 Generated by Copilot at ec95eea

golangci.yml
Configures linters for code
A winter project

HOW

🤖 Generated by Copilot at ec95eea

  • Add .golangci.yml file to configure the golangci-lint tool for the project (link)
  • Restrict the linting action to run only when .golangci.yml file is changed (link)
  • Use a list for the golangci-lint command line arguments and enable verbose output (link)

Makefile Outdated
@@ -828,6 +828,10 @@ lint:
@GOOS=linux go vet ./...
@GOOS=linux gosec -exclude=G204,G306,G404,G601,G301 -exclude-dir=test -exclude-dir=pkg/client ./...

.PHONY: gofumpt
gofumpt: gofumpt
find . -name "*.go" -execdir gofumpt -w -extra {} \;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用 -w 重写了,那 lint 的问题是不是就检查不出来了,但是 git 仓库里还没改

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的 ,这个步骤不该放流水线里面。可以手动执行。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Makefile Outdated Show resolved Hide resolved
@changluyi changluyi merged commit 8a3cf03 into master Sep 7, 2023
59 checks passed
@changluyi changluyi deleted the add_golang_lint branch September 7, 2023 06:47
bobz965 pushed a commit that referenced this pull request Sep 13, 2023
* add golang lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants