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

Does gofumpt ignore folders like testdata? #260

Closed
denizgursoy opened this issue Feb 11, 2023 · 2 comments
Closed

Does gofumpt ignore folders like testdata? #260

denizgursoy opened this issue Feb 11, 2023 · 2 comments

Comments

@denizgursoy
Copy link

I have a .go source file in a testdata directory. When I execute gofumpt -l -w -extra . it does not ignore the files under testdata. Should it ignore? or How I can ignore the testdata folders

@abhinav
Copy link

abhinav commented Mar 2, 2023

How are you invoking gofumpt?
gofumpt operates on a list of files, so if you give it a testdata/ file, it'll change it.

@mvdan
Copy link
Owner

mvdan commented Mar 16, 2023

The short answer is no; we do skip vendor directories when walking directory trees, but we don't skip testdata.

#250 has some more discussion on similar problems.

The more I think about it over time, the more I'm starting to think that we should skip both vendor and testdata directories when walking. If one really wants to format those, it would always possible to explicitly do so via gofumpt -l -w testdata vendor, for example.

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

No branches or pull requests

3 participants