-
Notifications
You must be signed in to change notification settings - Fork 119
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
IMP: Add golang
linter for PRs without blocking
#279
base: 2.7.1-dev
Are you sure you want to change the base?
Conversation
Must be over 1.14 to trigger automatic vendoring for potential linter usage. Should not impact building for JESSIE (testing).
Ignore #280 The real example is: thebeline#6 The example lint run is: https://github.com/thebeline/OctoScreen/pull/6/checks?check_run_id=2220183186 Example Annotations are at: https://github.com/thebeline/OctoScreen/pull/6/files Yeah... By my count that would be around 1400 Lint advisements... phew... |
The reports for |
Example Lint after removing Now only ~950 reports, mush betterer. Most are Line Length issues. I have it set to what we used to use in my previous job, 80 characters. This may seem short, but it ensures that full lines are readable from basically any shell or term width. |
Things I am noticing:
Like I said, for the time being this will not prevent PRs, and will just be for reviewer suggestions, but after we fine-tune it a bit, it will be incredibly helpful. Additionally, I am not sure why exactly, but in some cases the If I were to guess, I would guess that there were too many annotations/hits, and it chunked out. It would be uncommon for the linter to have to run on such a large file, so not really a concern... |
Last note: It should be mentioned that this also includes the |
@JeffB42 - Hrm... This is what killed me last year... I went down some sort of rabbit hole contributing to the linter repo and got all side-tracked. I need to round back to where I was and see what gives. I'll get back to this one shortly. |
This adds the
golangci-lint
action forPush
andPull Request
.A few notes on the implementation in this PR:
golangci-lint
with--issues-exit-code 0
, which will prevent it from blocking Pull Requests at this time.This will effectively make the linter/linters behave in strictly an annotation mode without impacting the Pull Request process. This will assist in the PR review process, but leave the ability to Merge or not fully in the hands on the maintainers. I would suggest that we make this blocking in the future, as the behaviour with
--issues-exit-code 0
is to always show a greenPASS
mark, which is mildly misleading, but not my call.At this time, it is acceptable, but after the initial integration, it will be advisable to fine-tune these settings as the maintainers see fit.
See the in-line notes, this can be resolved once we bring the Repo up to speed and spec with
golang1.16.x
which is currently blocked by the way we are handlingvendors/*
and Modules. This isn't urgent, but I figured I would mention it.lint
errors for changes included in the PR (viapatching
checks)uniq-by-line
because the default behaviour is to mask multiple issue on the same line (even if they are not "duplicates").Evidently this is expected behaviour. Which doesn't make sense to me, but 🤷♂️
I have run a bunch of tests on this by making PRs with limited introduced issues, I will make an example with
2.7.0
into an oldmaster
shortly.Resolves: #278