Skip to content
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

ci broken: golangci-lint changes breaks lint. #1423

Closed
arukiidou opened this issue Mar 27, 2024 · 0 comments · Fixed by #1424
Closed

ci broken: golangci-lint changes breaks lint. #1423

arukiidou opened this issue Mar 27, 2024 · 0 comments · Fixed by #1424

Comments

@arukiidou
Copy link
Contributor

arukiidou commented Mar 27, 2024

Describe the bug

ci breaks from golangci-lint changes.

run golangci-lint
  Running [/home/runner/golangci-lint-1.57.1-linux-amd64/golangci-lint run --out-format=github-actions --version] in [] ...
  Error: unknown flag: --version
  Failed executing command with error: unknown flag: --version
  
  Error: golangci-lint exit with code 3
  Ran golangci-lint in 80ms

To Reproduce

Just run CI, No need to change anything,

Expected behavior
A clear and concise description of what you expected to happen.

Additional context

Removing flag will resolve it.

golangci-lint run no longer have --version flags.

Usage:
  golangci-lint run [flags]

Flags:
  -c, --config PATH                    Read config from file path PATH
      --no-config                      Don't read config file
  -D, --disable strings                Disable specific linter
      --disable-all                    Disable all linters
  -E, --enable strings                 Enable specific linter
      --enable-all                     Enable all linters
      --fast                           Enable only fast linters from enabled linters set (first run won't be fast)
  -p, --presets strings                Enable presets (bugs|comment|complexity|error|format|import|metalinter|module|performance|sql|style|test|unused) of linters. Run 'golangci-lint help linters' to see them. This option implies option --disable-all
      --enable-only strings            Override linters configuration section to only run the specific linter(s)
  -j, --concurrency int                Number of CPUs to use (Default: number of logical CPUs) (default 12)
      --modules-download-mode string   Modules download mode. If not empty, passed as -mod=<mode> to go tools
      --issues-exit-code int           Exit code when issues were found (default 1)
      --go string                      Targeted Go version
      --build-tags strings             Build tags
      --timeout duration               Timeout for total work (default 1m0s)
      --tests                          Analyze tests (*_test.go) (default true)
      --allow-parallel-runners         Allow multiple parallel golangci-lint instances running. If false (default) - golangci-lint acquires file lock on start.
      --allow-serial-runners           Allow multiple golangci-lint instances running, but serialize them around a lock. If false (default) - golangci-lint exits with an error if it fails to acquire file lock on start.
      --out-format string              Formats of output: colored-line-number|line-number|json|tab|checkstyle|code-climate|html|junit-xml|github-actions|teamcity (default "colored-line-number")
      --print-issued-lines             Print lines of code with issue (default true)
      --print-linter-name              Print linter name in issue line (default true)
      --uniq-by-line                   Make issues output unique by line (default true)
      --sort-results                   Sort linter results
      --sort-order strings             Sort order of linter results
      --path-prefix string             Path prefix to add to output
      --show-stats                     Show statistics per linter
  -e, --exclude strings                Exclude issue by regexp
      --exclude-use-default            Use or not use default excludes:
      --exclude-case-sensitive         If set to true exclude and exclude rules regular expressions are case-sensitive
      --max-issues-per-linter int      Maximum issues count per one linter. Set to 0 to disable (default 50)
      --max-same-issues int            Maximum count of issues with the same text. Set to 0 to disable (default 3)
      --exclude-files strings          Regexps of files to exclude
      --exclude-dirs strings           Regexps of directories to exclude
      --exclude-dirs-use-default       Use or not use default excluded directories:
  -n, --new                            Show only new issues: if there are unstaged changes or untracked files, only those changes are analyzed, else only changes in HEAD~ are analyzed.
      --new-from-rev REV               Show only new issues created after git revision REV
      --new-from-patch PATH            Show only new issues created in git patch with file path PATH
      --whole-files                    Show issues in any part of update files (requires new-from-rev or new-from-patch)
      --fix                            Fix found issues (if it's supported by the linter)
      --cpu-profile-path string        Path to CPU profile output file
      --mem-profile-path string        Path to memory profile output file
      --print-resources-usage          Print avg and max memory usage of golangci-lint and total time
      --trace-path string              Path to trace output file

Global Flags:
      --color string   Use color when printing; can be 'always', 'auto', or 'never' (default "auto")
  -h, --help           Help for a command
  -v, --verbose        Verbose output
@arukiidou arukiidou changed the title ci broken: ci broken: golangci-lint changes nreaks lint. Mar 27, 2024
@arukiidou arukiidou changed the title ci broken: golangci-lint changes nreaks lint. ci broken: golangci-lint changes breaks lint. Mar 27, 2024
JacobOaks pushed a commit that referenced this issue Apr 2, 2024
`golangci-lint run` no longer accepts `--version`,
so the hack we employ to install it using the official action
no longer works.

This replaces the flag with `--help`, and fixes broken CI.

Resolves #1423

---------

Signed-off-by: junya koyama <arukiidou@yahoo.co.jp>
Co-authored-by: Abhinav Gupta <mail@abhinavg.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant