Skip to content

fix: fmt should check for unstaged files #5362

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
Dec 9, 2022
Merged

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Dec 9, 2022

Spotted in: https://github.com/coder/coder/actions/runs/3643167089/jobs/6151099869

--- shfmt
dogfood/main.tf
--- prettier
yarn run v1.22.19
$ prettier --cache --check '**/*.{css,html,js,json,jsx,md,ts,tsx,yaml,yml}' . ../ADOPTERS.md ../README.md ../docs
Checking formatting...
All matched files use Prettier code style!
Done in 2.8[6](https://github.com/coder/coder/actions/runs/3643167089/jobs/6151099869#step:6:7)s.

File dogfood/main.tf hasn't been formatted before, but fmt doesn't complain about it.

@mtojek mtojek self-assigned this Dec 9, 2022
@mtojek mtojek requested a review from a team December 9, 2022 09:18
@mtojek mtojek marked this pull request as ready for review December 9, 2022 09:18
@@ -274,6 +274,9 @@ jobs:
export PATH=${PATH}:$(go env GOPATH)/bin
make --output-sync -j -B fmt

- name: Check for unstaged files
run: ./scripts/check_unstaged.sh
Copy link
Member

Choose a reason for hiding this comment

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

I thinks this is good, should we also consider doing a CI conditional for terraform fmt -check like we do for prettier and shfmt?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I noticed your comment after merging. I can iterate on this if you like, but I assume that check_unstaged.sh as an ultimate check should work here well.

Copy link
Member

Choose a reason for hiding this comment

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

No worries, I'll leave it up to you. Ultimately this check is great to have as a catch-all, the other is just a minor improvement which doesn't bring much benefit.

@mtojek mtojek merged commit 935d2eb into coder:main Dec 9, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2022
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.

3 participants