-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
Implement //nolint parsing similar to golangci-lint #3562
Conversation
cdcfe2a
to
2de421e
Compare
Test failures appear unrelated to the change |
ceb3aa2
to
a7a4d63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me at first glance, but I am not familiar enough with nogo to review this more deeply.
@sluongng Could you take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great work @patrickmscott!! Damn impressive.
I have a small brain problem where I don't understand all of these though.
I think splitting these into 2 smaller PRs might be easier for reviewers to consume:
- Introduce
//nolint
+ relevant tests - Allow
//nolint: linterA,linterB
+ relevant tests
You would also want to update nogo
documentation to highlight what do we support.
Keep in mind that down in each analyzer, they could also have there own ignore lint error
directive, so we want to highlight that for future users of this feature to be aware of.
@sluongng I updated to use |
@sluongng any update? The test failure appears unrelated to my change. |
The failure should go away with a rebase onto master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look for nolint comments and collect the ranges of where they apply. If a node immediately follows a range with the same column, expand the range to include the node. Add tests that verify errors are filtered out.
Inline the new report function and add some comments about nolint ranges.
Include a failing test that shows the column issue. Will work on a fix.
This is better than the logic used by golangci-lint in that it does not incorrectly attribute an inline comment with the next line if it contains an ast.Node with a matching column (see inline_column test).
Use table driven tests and `CombinedOutput`.
bba5375
to
a66f2f3
Compare
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io_bazel_rules_go](https://togithub.com/bazelbuild/rules_go) | http_archive | minor | `v0.39.1` -> `v0.40.0` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>bazelbuild/rules_go</summary> ### [`v0.40.0`](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.40.0) [Compare Source](https://togithub.com/bazelbuild/rules_go/compare/v0.39.1...v0.40.0) #### What's Changed - Revert "Add automatic platform detection from inbound crosstool_top a… by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3468](https://togithub.com/bazelbuild/rules_go/pull/3468) - bzlmod: Add dedicated documentation by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3519](https://togithub.com/bazelbuild/rules_go/pull/3519) - Create TEST_SHARD_STATUS_FILE when sharding tests by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3547](https://togithub.com/bazelbuild/rules_go/pull/3547) - Move CI flags to .bazelrc and fix BwoB build by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3551](https://togithub.com/bazelbuild/rules_go/pull/3551) - Re-enable go_path_test on RBE by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3539](https://togithub.com/bazelbuild/rules_go/pull/3539) - nogo: provide usage doc by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3534](https://togithub.com/bazelbuild/rules_go/pull/3534) - respect global strip config by [@​malt3](https://togithub.com/malt3) in [https://github.com/bazelbuild/rules_go/pull/3527](https://togithub.com/bazelbuild/rules_go/pull/3527) - stdliblist: return generated files by [@​grampelberg](https://togithub.com/grampelberg) in [https://github.com/bazelbuild/rules_go/pull/3552](https://togithub.com/bazelbuild/rules_go/pull/3552) - Fix formatting in nogo usage doc by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3557](https://togithub.com/bazelbuild/rules_go/pull/3557) - Fix `goexperiment.*` build tags by [@​lbcjbb](https://togithub.com/lbcjbb) in [https://github.com/bazelbuild/rules_go/pull/3556](https://togithub.com/bazelbuild/rules_go/pull/3556) - Remove tests for `go_path`'s `link` mode by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3565](https://togithub.com/bazelbuild/rules_go/pull/3565) - Fix tests with `--incompatible_disable_starlark_host_transitions` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3560](https://togithub.com/bazelbuild/rules_go/pull/3560) - Create empty `.go` file in a random location by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3566](https://togithub.com/bazelbuild/rules_go/pull/3566) - gopackagesdriver: fix interface to work with golangci-lint ([#​3523](https://togithub.com/bazelbuild/rules_go/issues/3523)) by [@​grampelberg](https://togithub.com/grampelberg) in [https://github.com/bazelbuild/rules_go/pull/3524](https://togithub.com/bazelbuild/rules_go/pull/3524) - Fix typo in load statement for bzlmod docs by [@​Sovietaced](https://togithub.com/Sovietaced) in [https://github.com/bazelbuild/rules_go/pull/3570](https://togithub.com/bazelbuild/rules_go/pull/3570) - context: remove unused import by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3571](https://togithub.com/bazelbuild/rules_go/pull/3571) - docs: Mention `use_repo` automation by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3573](https://togithub.com/bazelbuild/rules_go/pull/3573) - Test basic-gazelle example with incompatible flags by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3575](https://togithub.com/bazelbuild/rules_go/pull/3575) - go_sdk extension: create `go_host_compatible_sdk` repository by [@​ylecornec](https://togithub.com/ylecornec) in [https://github.com/bazelbuild/rules_go/pull/3543](https://togithub.com/bazelbuild/rules_go/pull/3543) - docs: Mention that `gazelle:prefix` can be replaced by `go.mod` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3577](https://togithub.com/bazelbuild/rules_go/pull/3577) - go_download_sdk: apply extraction workaround to zips on non-windows OSs by [@​jayconrod](https://togithub.com/jayconrod) in [https://github.com/bazelbuild/rules_go/pull/3563](https://togithub.com/bazelbuild/rules_go/pull/3563) - Fix `go_download_sdk` with Bazel dev versions by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3580](https://togithub.com/bazelbuild/rules_go/pull/3580) - Implement //nolint parsing similar to golangci-lint by [@​patrickmscott](https://togithub.com/patrickmscott) in [https://github.com/bazelbuild/rules_go/pull/3562](https://togithub.com/bazelbuild/rules_go/pull/3562) #### New Contributors - [@​bricedp](https://togithub.com/bricedp) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3512](https://togithub.com/bazelbuild/rules_go/pull/3512) - [@​patrickmscott](https://togithub.com/patrickmscott) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3528](https://togithub.com/bazelbuild/rules_go/pull/3528) - [@​grampelberg](https://togithub.com/grampelberg) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3552](https://togithub.com/bazelbuild/rules_go/pull/3552) - [@​Sovietaced](https://togithub.com/Sovietaced) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3570](https://togithub.com/bazelbuild/rules_go/pull/3570) - [@​ylecornec](https://togithub.com/ylecornec) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3543](https://togithub.com/bazelbuild/rules_go/pull/3543) **Full Changelog**: bazel-contrib/rules_go@v0.39.1...v0.40.0 #### `WORKSPACE` code load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", sha256 = "bfc5ce70b9d1634ae54f4e7b495657a18a04e0d596785f672d35d5f505ab491a", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip", "https://github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip", ], ) load("@​io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() go_register_toolchains(version = "1.20.5") </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/kreempuff/rules_unreal_engine). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io_bazel_rules_go](https://togithub.com/bazelbuild/rules_go) | http_archive | minor | `v0.39.1` -> `v0.40.0` | --- ### Release Notes <details> <summary>bazelbuild/rules_go</summary> ### [`v0.40.0`](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.40.0) [Compare Source](https://togithub.com/bazelbuild/rules_go/compare/v0.39.1...v0.40.0) #### What's Changed - Revert "Add automatic platform detection from inbound crosstool_top a… by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3468](https://togithub.com/bazelbuild/rules_go/pull/3468) - bzlmod: Add dedicated documentation by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3519](https://togithub.com/bazelbuild/rules_go/pull/3519) - Create TEST_SHARD_STATUS_FILE when sharding tests by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3547](https://togithub.com/bazelbuild/rules_go/pull/3547) - Move CI flags to .bazelrc and fix BwoB build by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3551](https://togithub.com/bazelbuild/rules_go/pull/3551) - Re-enable go_path_test on RBE by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3539](https://togithub.com/bazelbuild/rules_go/pull/3539) - nogo: provide usage doc by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3534](https://togithub.com/bazelbuild/rules_go/pull/3534) - respect global strip config by [@​malt3](https://togithub.com/malt3) in [https://github.com/bazelbuild/rules_go/pull/3527](https://togithub.com/bazelbuild/rules_go/pull/3527) - stdliblist: return generated files by [@​grampelberg](https://togithub.com/grampelberg) in [https://github.com/bazelbuild/rules_go/pull/3552](https://togithub.com/bazelbuild/rules_go/pull/3552) - Fix formatting in nogo usage doc by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3557](https://togithub.com/bazelbuild/rules_go/pull/3557) - Fix `goexperiment.*` build tags by [@​lbcjbb](https://togithub.com/lbcjbb) in [https://github.com/bazelbuild/rules_go/pull/3556](https://togithub.com/bazelbuild/rules_go/pull/3556) - Remove tests for `go_path`'s `link` mode by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3565](https://togithub.com/bazelbuild/rules_go/pull/3565) - Fix tests with `--incompatible_disable_starlark_host_transitions` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3560](https://togithub.com/bazelbuild/rules_go/pull/3560) - Create empty `.go` file in a random location by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3566](https://togithub.com/bazelbuild/rules_go/pull/3566) - gopackagesdriver: fix interface to work with golangci-lint ([#​3523](https://togithub.com/bazelbuild/rules_go/issues/3523)) by [@​grampelberg](https://togithub.com/grampelberg) in [https://github.com/bazelbuild/rules_go/pull/3524](https://togithub.com/bazelbuild/rules_go/pull/3524) - Fix typo in load statement for bzlmod docs by [@​Sovietaced](https://togithub.com/Sovietaced) in [https://github.com/bazelbuild/rules_go/pull/3570](https://togithub.com/bazelbuild/rules_go/pull/3570) - context: remove unused import by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3571](https://togithub.com/bazelbuild/rules_go/pull/3571) - docs: Mention `use_repo` automation by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3573](https://togithub.com/bazelbuild/rules_go/pull/3573) - Test basic-gazelle example with incompatible flags by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3575](https://togithub.com/bazelbuild/rules_go/pull/3575) - go_sdk extension: create `go_host_compatible_sdk` repository by [@​ylecornec](https://togithub.com/ylecornec) in [https://github.com/bazelbuild/rules_go/pull/3543](https://togithub.com/bazelbuild/rules_go/pull/3543) - docs: Mention that `gazelle:prefix` can be replaced by `go.mod` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3577](https://togithub.com/bazelbuild/rules_go/pull/3577) - go_download_sdk: apply extraction workaround to zips on non-windows OSs by [@​jayconrod](https://togithub.com/jayconrod) in [https://github.com/bazelbuild/rules_go/pull/3563](https://togithub.com/bazelbuild/rules_go/pull/3563) - Fix `go_download_sdk` with Bazel dev versions by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3580](https://togithub.com/bazelbuild/rules_go/pull/3580) - Implement //nolint parsing similar to golangci-lint by [@​patrickmscott](https://togithub.com/patrickmscott) in [https://github.com/bazelbuild/rules_go/pull/3562](https://togithub.com/bazelbuild/rules_go/pull/3562) #### New Contributors - [@​bricedp](https://togithub.com/bricedp) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3512](https://togithub.com/bazelbuild/rules_go/pull/3512) - [@​patrickmscott](https://togithub.com/patrickmscott) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3528](https://togithub.com/bazelbuild/rules_go/pull/3528) - [@​grampelberg](https://togithub.com/grampelberg) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3552](https://togithub.com/bazelbuild/rules_go/pull/3552) - [@​Sovietaced](https://togithub.com/Sovietaced) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3570](https://togithub.com/bazelbuild/rules_go/pull/3570) - [@​ylecornec](https://togithub.com/ylecornec) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3543](https://togithub.com/bazelbuild/rules_go/pull/3543) **Full Changelog**: bazel-contrib/rules_go@v0.39.1...v0.40.0 #### `WORKSPACE` code load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", sha256 = "bfc5ce70b9d1634ae54f4e7b495657a18a04e0d596785f672d35d5f505ab491a", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip", "https://github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip", ], ) load("@​io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() go_register_toolchains(version = "1.20.5") </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/cgrindel/rules_swift_package_manager). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io_bazel_rules_go](https://togithub.com/bazelbuild/rules_go) | http_archive | minor | `v0.39.1` -> `v0.40.0` | --- ### Release Notes <details> <summary>bazelbuild/rules_go</summary> ### [`v0.40.0`](https://togithub.com/bazelbuild/rules_go/releases/tag/v0.40.0) [Compare Source](https://togithub.com/bazelbuild/rules_go/compare/v0.39.1...v0.40.0) #### What's Changed - Revert "Add automatic platform detection from inbound crosstool_top a… by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3468](https://togithub.com/bazelbuild/rules_go/pull/3468) - bzlmod: Add dedicated documentation by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3519](https://togithub.com/bazelbuild/rules_go/pull/3519) - Create TEST_SHARD_STATUS_FILE when sharding tests by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3547](https://togithub.com/bazelbuild/rules_go/pull/3547) - Move CI flags to .bazelrc and fix BwoB build by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3551](https://togithub.com/bazelbuild/rules_go/pull/3551) - Re-enable go_path_test on RBE by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3539](https://togithub.com/bazelbuild/rules_go/pull/3539) - nogo: provide usage doc by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3534](https://togithub.com/bazelbuild/rules_go/pull/3534) - respect global strip config by [@​malt3](https://togithub.com/malt3) in [https://github.com/bazelbuild/rules_go/pull/3527](https://togithub.com/bazelbuild/rules_go/pull/3527) - stdliblist: return generated files by [@​grampelberg](https://togithub.com/grampelberg) in [https://github.com/bazelbuild/rules_go/pull/3552](https://togithub.com/bazelbuild/rules_go/pull/3552) - Fix formatting in nogo usage doc by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3557](https://togithub.com/bazelbuild/rules_go/pull/3557) - Fix `goexperiment.*` build tags by [@​lbcjbb](https://togithub.com/lbcjbb) in [https://github.com/bazelbuild/rules_go/pull/3556](https://togithub.com/bazelbuild/rules_go/pull/3556) - Remove tests for `go_path`'s `link` mode by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3565](https://togithub.com/bazelbuild/rules_go/pull/3565) - Fix tests with `--incompatible_disable_starlark_host_transitions` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3560](https://togithub.com/bazelbuild/rules_go/pull/3560) - Create empty `.go` file in a random location by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3566](https://togithub.com/bazelbuild/rules_go/pull/3566) - gopackagesdriver: fix interface to work with golangci-lint ([#​3523](https://togithub.com/bazelbuild/rules_go/issues/3523)) by [@​grampelberg](https://togithub.com/grampelberg) in [https://github.com/bazelbuild/rules_go/pull/3524](https://togithub.com/bazelbuild/rules_go/pull/3524) - Fix typo in load statement for bzlmod docs by [@​Sovietaced](https://togithub.com/Sovietaced) in [https://github.com/bazelbuild/rules_go/pull/3570](https://togithub.com/bazelbuild/rules_go/pull/3570) - context: remove unused import by [@​sluongng](https://togithub.com/sluongng) in [https://github.com/bazelbuild/rules_go/pull/3571](https://togithub.com/bazelbuild/rules_go/pull/3571) - docs: Mention `use_repo` automation by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3573](https://togithub.com/bazelbuild/rules_go/pull/3573) - Test basic-gazelle example with incompatible flags by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3575](https://togithub.com/bazelbuild/rules_go/pull/3575) - go_sdk extension: create `go_host_compatible_sdk` repository by [@​ylecornec](https://togithub.com/ylecornec) in [https://github.com/bazelbuild/rules_go/pull/3543](https://togithub.com/bazelbuild/rules_go/pull/3543) - docs: Mention that `gazelle:prefix` can be replaced by `go.mod` by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3577](https://togithub.com/bazelbuild/rules_go/pull/3577) - go_download_sdk: apply extraction workaround to zips on non-windows OSs by [@​jayconrod](https://togithub.com/jayconrod) in [https://github.com/bazelbuild/rules_go/pull/3563](https://togithub.com/bazelbuild/rules_go/pull/3563) - Fix `go_download_sdk` with Bazel dev versions by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_go/pull/3580](https://togithub.com/bazelbuild/rules_go/pull/3580) - Implement //nolint parsing similar to golangci-lint by [@​patrickmscott](https://togithub.com/patrickmscott) in [https://github.com/bazelbuild/rules_go/pull/3562](https://togithub.com/bazelbuild/rules_go/pull/3562) #### New Contributors - [@​bricedp](https://togithub.com/bricedp) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3512](https://togithub.com/bazelbuild/rules_go/pull/3512) - [@​patrickmscott](https://togithub.com/patrickmscott) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3528](https://togithub.com/bazelbuild/rules_go/pull/3528) - [@​grampelberg](https://togithub.com/grampelberg) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3552](https://togithub.com/bazelbuild/rules_go/pull/3552) - [@​Sovietaced](https://togithub.com/Sovietaced) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3570](https://togithub.com/bazelbuild/rules_go/pull/3570) - [@​ylecornec](https://togithub.com/ylecornec) made their first contribution in [https://github.com/bazelbuild/rules_go/pull/3543](https://togithub.com/bazelbuild/rules_go/pull/3543) **Full Changelog**: bazel-contrib/rules_go@v0.39.1...v0.40.0 #### `WORKSPACE` code load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", sha256 = "bfc5ce70b9d1634ae54f4e7b495657a18a04e0d596785f672d35d5f505ab491a", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip", "https://github.com/bazelbuild/rules_go/releases/download/v0.40.0/rules_go-v0.40.0.zip", ], ) load("@​io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() go_register_toolchains(version = "1.20.5") </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/cgrindel/bazel-starlib). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Implement //nolint parsing similar to golangci-lint Look for nolint comments and collect the ranges of where they apply. If a node immediately follows a range with the same column, expand the range to include the node. Add tests that verify errors are filtered out. * Use a map instead of custom Linters type Inline the new report function and add some comments about nolint ranges. * Add separate tests for various filters Include a failing test that shows the column issue. Will work on a fix. * Use ast.CommentMap to associate comments to nodes This is better than the logic used by golangci-lint in that it does not incorrectly attribute an inline comment with the next line if it contains an ast.Node with a matching column (see inline_column test). * Address PR feedback Use table driven tests and `CombinedOutput`. --------- Co-authored-by: Patrick Scott <[email protected]>
#3561
Look for nolint comments and collect the ranges of where they apply. If a node immediately follows a range with the same column, expand the range to include the node.
Add tests that verify errors are filtered out.
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Parses
//nolint
comments and filters out errors from nogo.Which issues(s) does this PR fix?
Fixes #3561
Other notes for review