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

Introduce 'all' build tag for linting #15738

Closed
wants to merge 7 commits into from

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented May 5, 2021

By introducing a new 'all' build tag on all build conditionals, we can make the linters run on all files, eliminating two costly steps on each CI run. Thanks to golangci/golangci-lint#1646 (comment) for the idea.

@silverwind silverwind added topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile type/testing labels May 5, 2021
@silverwind
Copy link
Member Author

silverwind commented May 5, 2021

Added a check for this constraint as well, in case of error, it prints:

Please include the 'all' tag in all +build constraints, e.g. '// +build all yourtag'
build/generate-emoji.go:// +build ignore
make: *** [Makefile:277: build-constraints-check] Error 1

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 5, 2021
@silverwind silverwind added the pr/wip This PR is not ready for review label May 5, 2021
By introducing a new 'all' build tag on all build conditionals, we can
make the linters run on all files, eliminating two costly steps on each
CI run.
@silverwind
Copy link
Member Author

silverwind commented May 5, 2021

Put on WIP because it currently crashes with runtime: out of memory with the--build-tags all option. I'm pretty convinced that the previous version of golangci-lint linting did not honor the passed TAGS at all which I think means that all files with build tags are currently not being linted at all.

@silverwind
Copy link
Member Author

golangci took 33 minutes for whatever reason, I don't think this is going to work out as planned.

@silverwind silverwind closed this May 5, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. pr/wip This PR is not ready for review topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile type/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants