rog-golang-buddies / golang-template-repository

Kickstarter repository for a golang service
Apache License 2.0
17 stars 7 forks source link

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

Closed whutchinson98 closed 2 years ago

whutchinson98 commented 2 years ago

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

haani-niyaz commented 2 years ago

@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 commented 2 years ago

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