Skip to content

dev: run all commands on the CI #4526

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

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,44 @@ jobs:
env:
# needed for github-action-config.json generation
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Note: the command `run` is tested by the previous steps (`make test`).
commands:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to not forget to update this :D

maybe we need bash magic like

  1. run golangci-lint 42
  2. parse Available Commands:
  3. loop: run command from 2, parse Available Commands again
  4. etc

But, of course, explicit is better than implicit 🤷‍♂️

needs: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
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: ${{ env.GO_VERSION }}
- name: Build golangci-lint
run: make build

- run: ./golangci-lint

- run: ./golangci-lint cache
- run: ./golangci-lint cache status
- run: ./golangci-lint cache clean

- run: ./golangci-lint completion
- run: ./golangci-lint completion bash
- run: ./golangci-lint completion bash --no-descriptions
- run: ./golangci-lint completion zsh
- run: ./golangci-lint completion zsh --no-descriptions
- run: ./golangci-lint completion fish
- run: ./golangci-lint completion fish --no-descriptions
- run: ./golangci-lint completion powershell
- run: ./golangci-lint completion powershell --no-descriptions

- run: ./golangci-lint config
- run: ./golangci-lint config path

- run: ./golangci-lint help
- run: ./golangci-lint help linters
- run: ./golangci-lint linters
- run: ./golangci-lint version
5 changes: 5 additions & 0 deletions pkg/config/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ func (l *Loader) handleDeprecation() {
}

func (l *Loader) handleEnableOnlyOption() error {
lookup := l.fs.Lookup("enable-only")
if lookup == nil {
return nil
}

only, err := l.fs.GetStringSlice("enable-only")
if err != nil {
return err
Expand Down