Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: golangci/golangci-lint
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.59.1
Choose a base ref
...
head repository: golangci/golangci-lint
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.60.0
Choose a head ref

Commits on Jun 9, 2024

  1. Copy the full SHA
    8a8e6ef View commit details
  2. docs: update documentation assets (#4806)

    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    golangci-releaser and ldez authored Jun 9, 2024
    Copy the full SHA
    d2cb891 View commit details
  3. Copy the full SHA
    2eb8081 View commit details
  4. Copy the full SHA
    78f350b View commit details
  5. lll: Advertise max line length instead of just reporting failure (#4781)

    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    blast-hardcheese and ldez authored Jun 9, 2024
    Copy the full SHA
    eb23eaf View commit details
  6. build(deps): bump github.com/Crocmagnon/fatcontext from 0.2.2 to 0.3.0 (

    #4783)
    
    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    dependabot[bot] and ldez authored Jun 9, 2024
    Copy the full SHA
    784ea0e View commit details
  7. Copy the full SHA
    e2087c7 View commit details
  8. build(deps): bump github.com/bombsimon/wsl/v4 from 4.3.0 to 4.4.0 (#4807

    )
    
    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    dependabot[bot] and ldez authored Jun 9, 2024
    Copy the full SHA
    a2cc1c4 View commit details

Commits on Jun 10, 2024

  1. build(deps): bump github.com/sivchari/tenv from 1.7.1 to 1.9.1 (#4808)

    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    dependabot[bot] and ldez authored Jun 10, 2024
    Copy the full SHA
    a02629a View commit details
  2. Copy the full SHA
    464ad17 View commit details
  3. build(deps): bump golang.org/x/oauth2 from 0.20.0 to 0.21.0 in /scrip…

    …ts/gen_github_action_config (#4810)
    dependabot[bot] authored Jun 10, 2024
    Copy the full SHA
    0630262 View commit details
  4. Copy the full SHA
    0f289d8 View commit details
  5. Copy the full SHA
    6900260 View commit details

Commits on Jun 12, 2024

  1. Copy the full SHA
    53eadf2 View commit details
  2. Copy the full SHA
    bff93a1 View commit details
  3. Copy the full SHA
    df71654 View commit details

Commits on Jun 16, 2024

  1. Copy the full SHA
    7b776e4 View commit details
  2. Copy the full SHA
    8abf4fe View commit details
  3. Copy the full SHA
    2e2e14b View commit details
  4. Copy the full SHA
    9211eec View commit details

Commits on Jun 19, 2024

  1. fix: sanitize level property for SARIF (#4831)

    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    Zxilly and ldez authored Jun 19, 2024
    Copy the full SHA
    304e22a View commit details
  2. Copy the full SHA
    45efa67 View commit details

Commits on Jun 20, 2024

  1. Copy the full SHA
    dbd0935 View commit details

Commits on Jun 22, 2024

  1. Copy the full SHA
    6d66094 View commit details
  2. Copy the full SHA
    23f2390 View commit details
  3. Copy the full SHA
    4f9e50e View commit details

Commits on Jun 24, 2024

  1. Copy the full SHA
    967061e View commit details
  2. chore: update package-lock.json

    ldez committed Jun 24, 2024
    Copy the full SHA
    e72c4b7 View commit details

Commits on Jun 25, 2024

  1. Copy the full SHA
    819ab93 View commit details

Commits on Jun 26, 2024

  1. Copy the full SHA
    bc3a56a View commit details
  2. dev: rewrite benchmarks (#4848)

    ldez authored Jun 26, 2024
    Copy the full SHA
    e5d2d95 View commit details
  3. build(deps): bump github.com/moricho/tparallel from 0.3.1 to 0.3.2 (#…

    …4849)
    
    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    dependabot[bot] and ldez authored Jun 26, 2024
    Copy the full SHA
    a62f1f1 View commit details

Commits on Jun 30, 2024

  1. Copy the full SHA
    96bd9ef View commit details
  2. Copy the full SHA
    c5998e1 View commit details

Commits on Jul 3, 2024

  1. Copy the full SHA
    7745be9 View commit details
  2. Copy the full SHA
    229955e View commit details
  3. dev: add action to add checklist for new linter (#4855)

    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    bombsimon and ldez authored Jul 3, 2024
    Copy the full SHA
    8f348db View commit details

Commits on Jul 5, 2024

  1. Copy the full SHA
    1d23948 View commit details
  2. docs: improve grammar of new linter checklist (#4861)

    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    alexandear and ldez authored Jul 5, 2024
    Copy the full SHA
    cec6581 View commit details
  3. dev: fix code QL warning

    ldez committed Jul 5, 2024
    Copy the full SHA
    05cc266 View commit details

Commits on Jul 7, 2024

  1. Copy the full SHA
    aeacb54 View commit details
  2. Copy the full SHA
    283a9e7 View commit details

Commits on Jul 10, 2024

  1. build(deps): bump golang.org/x/tools from 0.22.0 to 0.23.0 (#4868)

    Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
    dependabot[bot] and ldez authored Jul 10, 2024
    Copy the full SHA
    ee37ef3 View commit details

Commits on Jul 14, 2024

  1. chore: fix checklist

    ldez committed Jul 14, 2024
    Copy the full SHA
    597b32a View commit details

Commits on Jul 16, 2024

  1. Copy the full SHA
    e95ac1b View commit details

Commits on Jul 24, 2024

  1. Copy the full SHA
    65ef38e View commit details
  2. Copy the full SHA
    e8300b7 View commit details
  3. Copy the full SHA
    d2b439f View commit details

Commits on Jul 28, 2024

  1. Copy the full SHA
    7cc813e View commit details
  2. Copy the full SHA
    113858f View commit details
Showing with 1,178 additions and 806 deletions.
  1. +72 −0 .github/new-linter-checklist.md
  2. +14 −12 .github/peril/package-lock.json
  3. 0 .github/workflows/{codeql.yaml → codeql.yml}
  4. +10 −26 .github/workflows/documentation.yml
  5. +32 −0 .github/workflows/new-linter-checklist.yml
  6. +20 −21 .github/workflows/post-release.yml
  7. +9 −24 .github/workflows/pr-documentation.yml
  8. +1 −1 .github/workflows/pr-extra.yml
  9. +33 −54 .github/workflows/pr.yml
  10. +5 −6 .github/workflows/tag.yml
  11. +85 −40 .golangci.next.reference.yml
  12. +64 −36 .golangci.reference.yml
  13. +2 −1 .goreleaser.yml
  14. +17 −0 CHANGELOG.md
  15. +4 −4 assets/github-action-config.json
  16. +3 −0 assets/linters-info.json
  17. +1 −1 build/buildx-alpine.Dockerfile
  18. +1 −1 build/buildx.Dockerfile
  19. +35 −130 docs/package-lock.json
  20. +0 −2 docs/src/config/sidebar.yml
  21. +1 −1 docs/src/docs/contributing/workflow.mdx
  22. +0 −30 docs/src/docs/product/trusted-by.mdx
  23. +1 −1 docs/src/docs/usage/linters.mdx
  24. +2 −0 docs/src/docs/welcome/install.mdx
  25. +23 −24 go.mod
  26. +49 −62 go.sum
  27. +20 −0 install.sh
  28. +26 −5 jsonschema/golangci.next.jsonschema.json
  29. +5 −5 pkg/commands/internal/builder.go
  30. +1 −1 pkg/commands/run.go
  31. +9 −3 pkg/config/linters_settings.go
  32. +7 −0 pkg/config/loader.go
  33. +41 −0 pkg/golinters/fatcontext/testdata/fatcontext.go
  34. +1 −1 pkg/golinters/govet/govet.go
  35. +0 −1 pkg/golinters/govet/govet_test.go
  36. +1 −1 pkg/golinters/govet/testdata/govet.go
  37. +1 −1 pkg/golinters/lll/lll.go
  38. +44 −14 pkg/golinters/revive/revive.go
  39. +0 −1 pkg/golinters/tenv/testdata/{tenv.go → tenv_default.go}
  40. 0 pkg/golinters/tenv/testdata/{tenv_test.go → tenv_default_test.go}
  41. +0 −16 pkg/golinters/tenv/testdata/tenv_fuzz.go
  42. +32 −9 pkg/golinters/testifylint/testdata/testifylint.go
  43. +19 −0 pkg/golinters/testifylint/testdata/testifylint_formatter_only.go
  44. +8 −0 pkg/golinters/testifylint/testdata/testifylint_formatter_only.yml
  45. +4 −0 pkg/golinters/testifylint/testifylint.go
  46. +7 −5 pkg/golinters/unused/unused.go
  47. +1 −0 pkg/golinters/wsl/wsl.go
  48. +2 −2 pkg/lint/lintersdb/builder_linter.go
  49. +3 −2 pkg/lint/runner.go
  50. +6 −1 pkg/printers/sarif.go
  51. +1 −1 pkg/printers/sarif_test.go
  52. +0 −5 pkg/result/processors/autogenerated_exclude.go
  53. +0 −8 pkg/result/processors/autogenerated_exclude_test.go
  54. +1 −1 pkg/result/processors/invalid_issue.go
  55. +23 −0 pkg/result/processors/issues.go
  56. +1 −1 pkg/result/processors/max_from_linter.go
  57. +1 −1 pkg/result/processors/max_per_file_from_linter.go
  58. +1 −1 pkg/result/processors/max_same_issues.go
  59. +1 −1 pkg/result/processors/uniq_by_line.go
  60. +5 −5 scripts/bench/bench_local.sh
  61. +3 −3 scripts/bench/bench_version.sh
  62. +3 −3 scripts/gen_github_action_config/go.mod
  63. +4 −4 scripts/gen_github_action_config/go.sum
  64. +124 −102 scripts/gen_github_action_config/main.go
  65. +7 −5 scripts/website/expand_templates/linters.go
  66. +280 −115 test/bench/bench_test.go
  67. +1 −4 test/run_test.go
  68. +0 −1 test/testshared/integration/run.go
72 changes: 72 additions & 0 deletions .github/new-linter-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements.

- [ ] The CLA must be signed

### Pull Request Description

- [ ] It must have a link to the linter repository.
- [ ] It must provide a short description of the linter.

### Linter

- [ ] It must not be a duplicate of another linter or a rule of a linter (the team will help to verify that).
- [ ] It must have a valid license (AGPL is not allowed), and the file must contain the required information by the license, ex: author, year, etc.
- [ ] It must use Go version <= 1.21
- [ ] The linter repository must have a CI and tests.
- [ ] It must use [`go/analysis`](https://golangci-lint.run/contributing/new-linters/).
- [ ] It must have a valid tag, ex: `v1.0.0`, `v0.1.0`.
- [ ] It must not contain `init()`.
- [ ] It must not contain `panic()`.
- [ ] It must not contain `log.Fatal()`, `os.Exit()`, or similar.
- [ ] It must not modify the AST.
- [ ] It must not have false positives/negatives (the team will help to verify that).
- [ ] It must have tests inside golangci-lint.

### The Linter Tests Inside Golangci-lint

- [ ] They must have at least one std lib import.
- [ ] They must have integration tests without configuration (default).
- [ ] They must have integration tests with configuration (if the linter has a configuration).

### `.golangci.next.reference.yml`

- [ ] The file `.golangci.next.reference.yml` must be updated.
- [ ] The file `.golangci.reference.yml` must NOT be edited.
- [ ] The linter must be added to the lists of available linters (alphabetical case-insensitive order).
- `enable` and `disable` options
- [ ] If the linter has a configuration, the exhaustive configuration of the linter must be added (alphabetical case-insensitive order)
- The values must be different from the default ones.
- The default values must be defined in a comment.
- The option must have a short description.

### Others Requirements

- [ ] The files (tests and linter) inside golangci-lint must have the same name as the linter.
- [ ] The `.golangci.yml` of golangci-lint itself must not be edited and the linter must not be added to this file.
- [ ] The linters must be sorted in the alphabetical order (case-insensitive) in the `lintersdb/builder_linter.go` and `.golangci.next.reference.yml`.
- [ ] The load mode (`WithLoadMode(...)`):
- if the linter uses `goanalysis.LoadModeSyntax` -> no `WithLoadForGoAnalysis()` in `lintersdb/builder_linter.go`
- if the linter uses `goanalysis.LoadModeTypesInfo`, it requires `WithLoadForGoAnalysis()` in `lintersdb/builder_linter.go`
- [ ] The version in `WithSince(...)` must be the next minor version (`v1.X.0`) of golangci-lint.
- [ ] `WithURL()` must contain the URL of the repository.

### Recommendations

- [ ] The file `jsonschema/golangci.next.jsonschema.json` should be updated.
- [ ] The file `jsonschema/golangci.jsonschema.json` must NOT be edited.
- [ ] The linter repository should have a readme and linting.
- [ ] The linter should be published as a binary (useful to diagnose bug origins).
- [ ] The linter repository should have a `.gitignore` (IDE files, binaries, OS files, etc. should not be committed)
- [ ] A tag should never be recreated.

---

The golangci-lint team will edit this comment to check the boxes before and during the review.

The code review will start after the completion of those checkboxes (except for the specific items that the team will help to verify).

The reviews should be addressed as commits (no squash).

If the author of the PR is a member of the golangci-lint team, he should not edit this message.

**This checklist does not imply that we will accept the linter.**
26 changes: 14 additions & 12 deletions .github/peril/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
36 changes: 10 additions & 26 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -11,49 +11,33 @@ jobs:
name: Build and deploy documentation
runs-on: ubuntu-latest
env:
GO_VERSION: '1.22'
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
GO_VERSION: '1.23'
NODE_VERSION: '20.x'
CGO_ENABLED: 0

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Cache Go modules
uses: actions/cache@v4
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: docs-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
docs-${{ runner.os }}-go-
- run: go mod download

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: docs/package-lock.json

- run: go mod download

- run: npm install --legacy-peer-deps
working-directory: ./docs

- name: Build Documentation
run: npm run build
working-directory: ./docs
run: npm run build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
32 changes: 32 additions & 0 deletions .github/workflows/new-linter-checklist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Add new linter checklist

on:
workflow_dispatch:
inputs:
pr:
description: PR number
required: true
type: number

permissions:
pull-requests: write

jobs:
add-comment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Add checklist
run: |
# Avoid adding multiple comments for the same PR.
comment_exist=$(gh pr view "$NUMBER" \
--json comments \
--jq '.comments[].author | select(.login=="github-actions") | .login' \
| wc -l)
[ "$comment_exist" -gt 0 ] && edit_last="--edit-last"
gh pr comment "$NUMBER" --body "$(cat .github/new-linter-checklist.md)" $edit_last
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ inputs.pr }}
41 changes: 20 additions & 21 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
@@ -11,16 +11,16 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
GO_VERSION: '1.23'
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: '1.22'
go-version: ${{ env.GO_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: "15"
@@ -49,14 +49,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: '1.22'
go-version: ${{ env.GO_VERSION }}

- name: Update GitHub Action config
run: make assets/github-action-config.json
@@ -77,14 +72,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: '1.22'
go-version: ${{ env.GO_VERSION }}

- name: Update reference files
run: cp .golangci.next.reference.yml .golangci.reference.yml
@@ -103,3 +93,12 @@ jobs:
branch-suffix: timestamp
title: "docs: update documentation assets"
delete-branch: true

check-install-script:
name: Installation script (remote)
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "./install-golangci-lint"
33 changes: 9 additions & 24 deletions .github/workflows/pr-documentation.yml
Original file line number Diff line number Diff line change
@@ -9,43 +9,28 @@ jobs:
name: Build documentation
runs-on: ubuntu-latest
env:
GO_VERSION: '1.22'
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
GO_VERSION: '1.23'
NODE_VERSION: '20.x'
CGO_ENABLED: 0

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Cache Go modules
uses: actions/cache@v4
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: docs-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
docs-${{ runner.os }}-go-
- run: go mod download

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: docs/package-lock.json

- run: go mod download

- run: npm install --legacy-peer-deps
working-directory: ./docs

2 changes: 1 addition & 1 deletion .github/workflows/pr-extra.yml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ jobs:
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: '1.22'
go-version: '1.23'
- name: Run go list
run: go list -json -m all > go.list
- name: Nancy
Loading