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

Golangci-lint linter only files changeed in PR. #5745

Closed
2 tasks
dekiel opened this issue Jul 18, 2022 · 5 comments
Closed
2 tasks

Golangci-lint linter only files changeed in PR. #5745

dekiel opened this issue Jul 18, 2022 · 5 comments
Labels
area/ci Issues or PRs related to CI related topics

Comments

@dekiel
Copy link
Contributor

dekiel commented Jul 18, 2022

Description

Golangcli-lint must allow to check files which were changed in PR.

Reasons

Developer doesn't want to fix other component code on it's PR when there was no changes in other component files.

Acceptance Criteria

  • Tool is able to operate on files changed in PR only.
  • Tool has flag to run against entire repository.

Parent: #4943

@dekiel dekiel added the area/ci Issues or PRs related to CI related topics label Jul 18, 2022
@dekiel dekiel mentioned this issue Jul 18, 2022
11 tasks
@github-actions
Copy link

This issue has been automatically marked as stale due to the lack of recent activity. It will soon be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 17, 2022
@dekiel dekiel removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 20, 2022
@Ressetkk
Copy link
Contributor

When Prow runs the tests on PRs it performs a rebase of the changes against latest revision of main branch AFAIK. Additionally Prow provides variable PULL_BASE_SHA which points the SHA of a latest revision from a branch PR is opened.
You can get all changed files between latest PR changes and branch you merge into by using command

git diff --name-only --diff-filter=d $PULL_BASE_SHA..HEAD

With golangci-lint this should work with the following command:

golangci-lint run --new-from-rev=$PULL_BASE_SHA

or something like that. Worth checking!

@kyma-bot
Copy link
Contributor

This issue or PR has been automatically marked as stale due to the lack of recent activity.
Thank you for your contributions.

This bot triages issues and PRs according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied
  • After 7d of inactivity since lifecycle/stale was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Close this issue or PR with /close

If you think that I work incorrectly, kindly raise an issue with the problem.

/lifecycle stale

@kyma-bot kyma-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 19, 2022
@tobiscr tobiscr removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 24, 2022
@kyma-bot
Copy link
Contributor

This issue or PR has been automatically marked as stale due to the lack of recent activity.
Thank you for your contributions.

This bot triages issues and PRs according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied
  • After 7d of inactivity since lifecycle/stale was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Close this issue or PR with /close

If you think that I work incorrectly, kindly raise an issue with the problem.

/lifecycle stale

@kyma-bot kyma-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 23, 2023
@Ressetkk
Copy link
Contributor

golangci-lint that we use can work only on changed files in a PR. There is no need to reimplement this feature.

@dekiel dekiel removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci Issues or PRs related to CI related topics
Projects
None yet
Development

No branches or pull requests

4 participants