Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature request: run linter a few times #449

Open
@kolyshkin

Description

@kolyshkin

In my repository (https://github.com/opencontainers/runc) I use two distinct linter configs:

  • one where all default linters, and some non-default ones, are enabled
  • one where only a couple of extra linters are enabled

The first config is used everywhere (on main and release branches, as well as for PRs)

The second config is

  • aimed at new code only (and so it hasonly-new-issues: true)
  • aimed at PRs only (and so it hasif: github.event_name == 'pull_request')

The idea behind this setup is simple: since we have a pretty big codebase, we can't possibly modify it to satisfy some more stricter and/or opinionated linters (such asgodot,revive,gocritic, ordupl), nor it makes sense to do so -- but we can impose stricter standards for the newly added code.

Now, the GHA CI implementation (with the.golangci-extra.yml file with extra linters) looks like this:

jobs:lint:runs-on:ubuntu-20.04steps:      -uses:actions/checkout@v3      -uses:actions/setup-go@v3with:go-version:"${{ env.GO_VERSION }}"      -name:install depsrun:|          sudo apt -q update          sudo apt -q install libseccomp-dev      -uses:golangci/golangci-lint-action@v3with:version:"${{ env.LINT_VERSION }}"# Extra linters, only checking new code from pull requests.      -uses:golangci/golangci-lint-action@v3if:github.event_name == 'pull_request'with:only-new-issues:trueargs:--config .golangci-extra.ymlversion:"${{ env.LINT_VERSION }}"

All this works, except that since I usegolangci/golangci-lint-action twice, it actually downloads and installs golangci-lint twice (for example, see the log athttps://github.com/opencontainers/runc/runs/5982042602?check_suite_focus=true.

** Proposal ** modify the action to detect that it is being used for the second time, and skip the second, redundant golangci-lint setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp