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

How can I restrict pull request diffs to only be linted?#943

Answeredbyldez
hiroyuki-fujii-td asked this question inQ&A
Discussion options

By default, when I run golangci-lint on Github Actions, golangci-lint applies all linters to all repository files.
I wanna know how to restrict target files only pull-req diff.

.golangci.yaml
run:  deadline: 5mlinters:  disable-all: true  enable:    - asciicheck    - errcheck    - gofmt    - goimports    - govet    - ineffassign    - lll    - misspell    - prealloc    - staticcheck    - typecheck    - unused    - whitespacelinters-settings:  lll:    line-length: 140
golangci-lint.yaml
name: golangci-linton:  push:    branches:      - develop  pull_request:permissions:  contents: readjobs:  golangci:    name: lint    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - uses: actions/setup-go@v5        with:          go-version: '1.20'          cache: false      - name: golangci-lint        uses: golangci/golangci-lint-action@v3        with:          version: latest

best regards.

You must be logged in to vote

Replies: 1 comment

Comment options

ldez
May 4, 2024
Maintainer

You should use theonly-new-issues option.

https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#only-new-issues

You must be logged in to vote
0 replies
Answer selected byldez
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@hiroyuki-fujii-td@ldez

[8]ページ先頭

©2009-2025 Movatter.jp