-
Notifications
You must be signed in to change notification settings - Fork 805
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
Skip .git folder when searching for *.go files #6118
Conversation
Apparently that was being searched, and it cnoticed a "thing.go" folder that git made! So now this has two improvements: 1. it does not step into the .git folder, because obviously there is no source that needs formatting in there 2. it only finds files, `-type f`, because directories aren't source files Both pretty obvious in retrospect.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted filessee 10 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Pull Request Test Coverage Report for Build 018feaa8-4d2b-4152-bf5a-38f1696b2d57Details
💛 - Coveralls |
Apparently that was being searched, and it noticed a "thing.go" folder that git made! So now this has two improvements: 1. it does not step into the `.git` folder, because obviously there is no source that needs formatting in there 2. it only finds files, `-type f`, because directories aren't source files Both pretty obviously good to have in retrospect. --- A way to validate this kind of change for the future: 1. change the `SHELL = ...` line near the top of the makefile to include a `-x` debug flag. `make` will now print all the shell commands it runs, including this `find`. 2. copy it and run it by hand and check the output. in particular, this time I just had it find _all_ files to check where it looked, and made sure the list was reasonable (it included my local .idea, but that seems fine, it's small and has no go files) I should've done 2 earlier when I added this `find` command, I likely would have noticed the directories and `.git` and removed them. Sorry about that.
Apparently that was being searched, and it noticed a "thing.go" folder that git made! So now this has two improvements: 1. it does not step into the `.git` folder, because obviously there is no source that needs formatting in there 2. it only finds files, `-type f`, because directories aren't source files Both pretty obviously good to have in retrospect. --- A way to validate this kind of change for the future: 1. change the `SHELL = ...` line near the top of the makefile to include a `-x` debug flag. `make` will now print all the shell commands it runs, including this `find`. 2. copy it and run it by hand and check the output. in particular, this time I just had it find _all_ files to check where it looked, and made sure the list was reasonable (it included my local .idea, but that seems fine, it's small and has no go files) I should've done 2 earlier when I added this `find` command, I likely would have noticed the directories and `.git` and removed them. Sorry about that.
Apparently that was being searched, and it noticed a "thing.go" folder that git made!
So now this has two improvements:
.git
folder, because obviously there is no source that needs formatting in there-type f
, because directories aren't source filesBoth pretty obviously good to have in retrospect.
A way to validate this kind of change for the future:
SHELL = ...
line near the top of the makefile to include a-x
debug flag.make
will now print all the$(shell ...)
commands it runs, including thisfind
.in particular, this time I just had it find all files to check where it looked, and made sure the list was reasonable
(it included my local .idea, but that seems fine, it's small and has no go files)
I should've done 2 earlier when I added this
find
command, I likely would have noticed the directories and.git
and removed them. Sorry about that.