Skip to content

Commit f2709ec

Browse files
committed
feat: remove golangci-lint
In preparation for 1.0, we want all linters to work correctly. In the discussion for #129 we decided that is a fatal bug, and no one is able to fix it in the short term. We're happy to add Go linting back to rules_lint when someone has a correct implementation that handles transitive srcs. The code will still be here in the git history when it's time to revive it. Closes #129
1 parent 5ac8a21 commit f2709ec

13 files changed

+2
-258
lines changed

MODULE.bazel

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ bazel_dep(name = "rules_proto", version = "6.0.0-rc2")
2424
bazel_dep(name = "rules_buf", version = "0.1.1")
2525
bazel_dep(name = "toolchains_protoc", version = "0.2.1")
2626

27-
# Needed to get the 'go_context' symbol, to invoke golangci-lint
28-
bazel_dep(name = "rules_go", version = "0.39.1", repo_name = "io_bazel_rules_go")
29-
3027
multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool")
3128
multitool.hub(lockfile = "//format:multitool.lock.json")
3229
multitool.hub(lockfile = "//lint:multitool.lock.json")

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ New tools are being added frequently, so check this page again!
2424
| ---------------------- | --------------------- | ---------------- |
2525
| C / C++ | [clang-format] | ([#112]) |
2626
| CSS | [Prettier] | |
27-
| Go | [gofmt] or [gofumpt] | [golangci-lint] |
27+
| Go | [gofmt] or [gofumpt] | |
2828
| HCL (Hashicorp Config) | [terraform] fmt | |
2929
| HTML | [Prettier] | |
3030
| JSON | [Prettier] | |
@@ -63,7 +63,6 @@ New tools are being added frequently, so check this page again!
6363
[ruff]: https://docs.astral.sh/ruff/
6464
[shellcheck]: https://www.shellcheck.net/
6565
[shfmt]: https://github.com/mvdan/sh
66-
[golangci-lint]: https://github.com/golangci/golangci-lint
6766
[clang-format]: https://clang.llvm.org/docs/ClangFormat.html
6867
[#112]: https://github.com/aspect-build/rules_lint/issues/112
6968
[vale]: https://vale.sh/

docs/BUILD.bazel

-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ stardoc_with_diff_test(
3737
bzl_library_target = "//lint:ruff",
3838
)
3939

40-
stardoc_with_diff_test(
41-
name = "golangci-lint",
42-
bzl_library_target = "//lint:golangci-lint",
43-
)
44-
4540
stardoc_with_diff_test(
4641
name = "shellcheck",
4742
bzl_library_target = "//lint:shellcheck",

docs/golangci-lint.md

-63
This file was deleted.

example/.aspect/cli/config.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ lint:
33
- //tools/lint:linters.bzl%eslint
44
- //tools/lint:linters.bzl%buf
55
- //tools/lint:linters.bzl%flake8
6-
- //tools/lint:linters.bzl%golangci_lint
76
- //tools/lint:linters.bzl%pmd
87
- //tools/lint:linters.bzl%ruff
98
- //tools/lint:linters.bzl%vale

example/.golangci.yaml

-21
This file was deleted.

example/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ exports_files(
1919
".ruff.toml",
2020
".shellcheckrc",
2121
".scalafmt.conf",
22-
".golangci.yaml",
2322
".vale.ini",
2423
],
2524
visibility = ["//visibility:public"],

example/lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ filter='.namedSetOfFiles | values | .files[] | ((.pathPrefix | join("/")) + "/"
2424

2525
# NB: perhaps --remote_download_toplevel is needed as well with remote execution?
2626
args=(
27-
"--aspects=$(echo //tools/lint:linters.bzl%{buf,eslint,flake8,pmd,ruff,shellcheck,golangci_lint,vale} | tr ' ' ',')"
27+
"--aspects=$(echo //tools/lint:linters.bzl%{buf,eslint,flake8,pmd,ruff,shellcheck,vale} | tr ' ' ',')"
2828
"--build_event_json_file=$buildevents"
2929
)
3030
report_args=(

example/test/lint_test.bats

-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ EOF
2828
# Buf
2929
assert_output --partial 'src/file.proto:1:1:Import "src/unused.proto" is unused.'
3030

31-
# Golangci-lint
32-
assert_output --partial 'src/hello.go:13:2: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)'
33-
3431
# Vale
3532
assert_output --partial "src/README.md:3:47:Google.We:Try to avoid using first-person plural like 'We'."
3633
}

example/tools/lint/linters.bzl

-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
load("@aspect_rules_lint//lint:buf.bzl", "lint_buf_aspect")
44
load("@aspect_rules_lint//lint:eslint.bzl", "lint_eslint_aspect")
55
load("@aspect_rules_lint//lint:flake8.bzl", "lint_flake8_aspect")
6-
load("@aspect_rules_lint//lint:golangci-lint.bzl", "lint_golangci_aspect")
76
load("@aspect_rules_lint//lint:lint_test.bzl", "lint_test")
87
load("@aspect_rules_lint//lint:pmd.bzl", "lint_pmd_aspect")
98
load("@aspect_rules_lint//lint:ruff.bzl", "lint_ruff_aspect")
@@ -57,13 +56,6 @@ shellcheck = lint_shellcheck_aspect(
5756

5857
shellcheck_test = lint_test(aspect = shellcheck)
5958

60-
golangci_lint = lint_golangci_aspect(
61-
binary = "@multitool//tools/golangci-lint",
62-
config = "@@//:.golangci.yaml",
63-
)
64-
65-
golangci_lint_test = lint_test(aspect = golangci_lint)
66-
6759
vale = lint_vale_aspect(
6860
binary = "@@//tools/lint:vale",
6961
config = "@@//:.vale.ini",

lint/BUILD.bazel

-10
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,6 @@ bzl_library(
118118
],
119119
)
120120

121-
bzl_library(
122-
name = "golangci-lint",
123-
srcs = ["golangci-lint.bzl"],
124-
visibility = ["//visibility:public"],
125-
deps = [
126-
"//lint/private:lint_aspect",
127-
"@io_bazel_rules_go//go:def",
128-
],
129-
)
130-
131121
bzl_library(
132122
name = "shellcheck",
133123
srcs = ["shellcheck.bzl"],

lint/golangci-lint.bzl

-104
This file was deleted.

lint/multitool.lock.json

-36
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,5 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/theoremlp/rules_multitool/main/lockfile.schema.json",
3-
"golangci-lint": {
4-
"binaries": [
5-
{
6-
"os": "linux",
7-
"cpu": "x86_64",
8-
"kind": "archive",
9-
"url": "https://github.com/golangci/golangci-lint/releases/download/v1.55.2/golangci-lint-1.55.2-linux-amd64.tar.gz",
10-
"sha256": "ca21c961a33be3bc15e4292dc40c98c8dcc5463a7b6768a3afc123761630c09c",
11-
"file": "golangci-lint-1.55.2-linux-amd64/golangci-lint"
12-
},
13-
{
14-
"os": "linux",
15-
"cpu": "arm64",
16-
"kind": "archive",
17-
"url": "https://github.com/golangci/golangci-lint/releases/download/v1.55.2/golangci-lint-1.55.2-linux-arm64.tar.gz",
18-
"sha256": "8eb0cee9b1dbf0eaa49871798c7f8a5b35f2960c52d776a5f31eb7d886b92746",
19-
"file": "golangci-lint-1.55.2-linux-arm64/golangci-lint"
20-
},
21-
{
22-
"os": "macos",
23-
"cpu": "x86_64",
24-
"kind": "archive",
25-
"url": "https://github.com/golangci/golangci-lint/releases/download/v1.55.2/golangci-lint-1.55.2-darwin-amd64.tar.gz",
26-
"sha256": "632e96e6d5294fbbe7b2c410a49c8fa01c60712a0af85a567de85bcc1623ea21",
27-
"file": "golangci-lint-1.55.2-darwin-amd64/golangci-lint"
28-
},
29-
{
30-
"os": "macos",
31-
"cpu": "arm64",
32-
"kind": "archive",
33-
"url": "https://github.com/golangci/golangci-lint/releases/download/v1.55.2/golangci-lint-1.55.2-darwin-arm64.tar.gz",
34-
"sha256": "234463f059249f82045824afdcdd5db5682d0593052f58f6a3039a0a1c3899f6",
35-
"file": "golangci-lint-1.55.2-darwin-arm64/golangci-lint"
36-
}
37-
]
38-
},
393
"shellcheck": {
404
"binaries": [
415
{

0 commit comments

Comments
 (0)