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

only run gofumpt on .go files in pre-commit hook #2983

Merged
merged 1 commit into from
Jan 6, 2021

Conversation

marten-seemann
Copy link
Member

Editing README.md otherwise produces a warning like this:

README.md:1:1: illegal character U+0023 '#'

@marten-seemann marten-seemann changed the title only run gofumpt in .go files in pre-commit hook only run gofumpt on .go files in pre-commit hook Jan 4, 2021
@codecov
Copy link

codecov bot commented Jan 4, 2021

Codecov Report

Merging #2983 (a6c7671) into master (4c079b9) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2983   +/-   ##
=======================================
  Coverage   86.12%   86.12%           
=======================================
  Files         135      135           
  Lines        9379     9379           
=======================================
  Hits         8077     8077           
  Misses        943      943           
  Partials      359      359           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c079b9...a6c7671. Read the comment docs.

Copy link

@mvdan mvdan left a comment

Choose a reason for hiding this comment

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

Huh, I would have thought that *.go would be enough for git. Is three stars any different?

@marten-seemann
Copy link
Member Author

@mvdan You're right. The 3 stars are supposed to do recursive matching, however...

 git diff --cached --name-only -- '*.go'

already matches recursively, whereas

 git diff --cached --name-only -- *.go

does not. By the way,

 git diff --cached --name-only -- ***.go

doesn't match recursively either, but

git diff --cached --name-only -- **/*.go

does.

Please remember this for the next time you use git to filter through files ;)

@marten-seemann marten-seemann merged commit d1c5297 into master Jan 6, 2021
@mvdan
Copy link

mvdan commented Jan 6, 2021

Those are different :) I always use '*.go', since that literally just passes that string to git, meaning "any indexed file which has a go extension". Without the quoting, then the shell just tries to expand to the Go files in the current directory, which is entirely different.

@marten-seemann marten-seemann deleted the gofumpt-limit-to-go-files branch January 7, 2021 02:38
@aschmahmann aschmahmann mentioned this pull request May 14, 2021
71 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants