useless-fallthrough: do not report fallthrough before default #3071
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| go-mod: | |
| name: Check go.mod | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: stable | |
| - name: Check go.mod | |
| run: | | |
| go mod tidy | |
| git diff --exit-code go.mod | |
| git diff --exit-code go.sum | |
| lint-go: | |
| name: Lint Go | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@v4 | |
| - name: Setup Go and register problem matcher | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: stable | |
| - name: Install revive | |
| run: go install | |
| - name: Run revive | |
| run: revive --config revive.toml ./... | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v8 | |
| with: | |
| version: v2.2.1 | |
| lint-md: | |
| name: Lint Markdown | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: stable | |
| - name: Setup mdsf | |
| uses: hougesen/[email protected] | |
| - name: Setup goimports | |
| # https://pkg.go.dev/golang.org/x/tools/cmd/goimports | |
| run: go install golang.org/x/tools/cmd/[email protected] | |
| - name: Setup shfmt | |
| # https://github.com/mvdan/sh#shfmt | |
| run: go install mvdan.cc/sh/v3/cmd/[email protected] | |
| - name: Setup taplo | |
| # https://taplo.tamasfe.dev/cli/installation/binary.html | |
| run: curl -fsSL https://github.com/tamasfe/taplo/releases/download/0.10.0/taplo-linux-x86_64.gz | gzip -d - | install -m 755 /dev/stdin /usr/local/bin/taplo | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install markdown-toc | |
| run: npm install -g markdown-toc | |
| - name: Verify files format using markdownlint-cli2 | |
| uses: DavidAnson/markdownlint-cli2-action@v20 | |
| with: | |
| config: .markdownlint-cli2.yaml | |
| - name: Verify TOC in markdown files | |
| run: | | |
| markdown-toc --maxdepth 4 --no-first1 --bullets "-" -i README.md && git diff --exit-code README.md | |
| markdown-toc --maxdepth 2 --no-first1 --bullets "-" -i RULES_DESCRIPTIONS.md && git diff --exit-code RULES_DESCRIPTIONS.md | |
| - name: Verify code snippets using mdsf | |
| id: verify_snippets | |
| run: mdsf verify --on-missing-language-definition ignore --on-missing-tool-binary fail-fast . | |
| - name: Show diff when mdsf failed | |
| if: failure() && steps.verify_snippets.outcome == 'failure' | |
| run: | | |
| mdsf format --debug --on-missing-language-definition ignore --on-missing-tool-binary fail-fast . | |
| git diff --exit-code |