Skip to content

When a PR is open the golangci-lint job is running twice #59

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

Closed
whutchinson98 opened this issue Jul 15, 2022 · 2 comments
Closed

When a PR is open the golangci-lint job is running twice #59

whutchinson98 opened this issue Jul 15, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@whutchinson98
Copy link

image

Proposal for fix:
Only have the job run on pull_request into branch main as it doesn't really matter if the lint fails until it is trying to be merged into main

@whutchinson98 whutchinson98 added the bug Something isn't working label Jul 15, 2022
@whutchinson98 whutchinson98 self-assigned this Jul 15, 2022
@haani-niyaz
Copy link
Collaborator

haani-niyaz commented Jul 16, 2022

@whutchinson98 this was planned to be addressed in #46. Although it sets the job to run on push only for gitleaks, tests and linting.

My rationale for this was to get early feedback instead of discovering the potentially sizeable refactoring effort needed if left until the end. For instance, when the linter runs (if setup with valid options) it might pick up on a patterns that are discouraged. Having this feedback early will aid the developer to fix-on-fail instead of perhaps propagating the anti-pattern in multiple places and then having to fix a larger a codebase.

I'm also aware that this may get picked up locally via the pre-commit hook but it relies on the developer installing the hook so it is not a guarantee.

@whutchinson98
Copy link
Author

Sounds good, I'll close this issue and associated PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants