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

cmd/gofmt: gofmt doesn't ignore directories prefixed with _ #8091

Open
gopherbot opened this issue May 24, 2014 · 4 comments
Open

cmd/gofmt: gofmt doesn't ignore directories prefixed with _ #8091

gopherbot opened this issue May 24, 2014 · 4 comments
Labels
Milestone

Comments

@gopherbot
Copy link

by onsi@pivotallabs.com:

go test ./... ignores directories prefixed with _.  This is convenient and seems like a
reasonable rule of thumb.

gofmt -w . 

does *not* honor this "rule"

With the ascendance of Godeps there are now Godeps/_workspace folders vendoring
dependencies all over the place.  Having gofmt -w . rewrite my dependencies is painful. 
Any change the "ignore _" rule could be ported over to gofmt sometime soon? 
Would be happy to work on a pull request for this.
@cznic
Copy link
Contributor

cznic commented May 25, 2014

Comment 1:

gofmt is not part of the go tool and the desired behavior of the go tool is nowhere
specified to apply to gofmt. Use instead, for example,
        $ go fmt ./...
It works as expected, ie. it ignores directories starting with the underscore character.
#WAI

@gopherbot
Copy link
Author

Comment 2 by onsijoe:

Yes, but go fmt doesn't support rewrite rules... which is the usecase I'm struggling
with.

@griesemer
Copy link
Contributor

Comment 3:

This is a feature request for gofmt, not go fmt.
This is not urgent since it's easy to apply gofmt selectively to a list of files
(possibly created using Unix find and friends).

Labels changed: added release-none, repo-main.

Status changed to Thinking.

@griesemer
Copy link
Contributor

Comment 4:

Owner changed to @griesemer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants