Skip to content

fix: check unstaged files during ci lint #15120

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 1 commit into from
Oct 17, 2024
Merged

fix: check unstaged files during ci lint #15120

merged 1 commit into from
Oct 17, 2024

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Oct 17, 2024

golangci-lint run makes changes to files for trivial lints, such as import ordering, but CI doesn't currently check for these changes like it does for fmt and gen. It might be possible to have golangci-lint return an error when it makes a change, but that would only be for Go, and it seems sensible to have it be language agnostic.

There's perhaps an argument to be made (at least in my head) that lint shouldn't be making changes, only raising warnings/errors, but that's not what golangci-lint has decided.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ethanndickson and the rest of your teammates on Graphite Graphite

Copy link

@cdr-bot cdr-bot bot left a comment

Choose a reason for hiding this comment

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

This PR is a hotfix and has been automatically approved.

  • ✅ Base is main or release branch
  • ✅ Has hotfix label
  • ✅ Head is from coder/coder
  • ✅ Less than 100 lines

@@ -223,6 +223,12 @@ jobs:
./actionlint -color -shellcheck= -ignore "set-output"
shell: bash

- name: Check for unstaged files
run: |
rm -f ./actionlint ./typos
Copy link
Member Author

Choose a reason for hiding this comment

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

The typos action we use doesn't let you modify the binary install directory to anything other than the current directory (Is there a good reason why?)

@ethanndickson ethanndickson marked this pull request as ready for review October 17, 2024 05:32
@ethanndickson ethanndickson enabled auto-merge (squash) October 17, 2024 05:32
@ethanndickson ethanndickson merged commit 46cce33 into main Oct 17, 2024
36 checks passed
@ethanndickson ethanndickson deleted the ethan/lint-ci branch October 17, 2024 05:37
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant