Skip to content

Conversation

mvdan
Copy link
Owner

@mvdan mvdan commented Feb 20, 2022

(see commit message)

Fixes #180.

Otherwise it's very hard to apply gofumpt rules to generated code.
It still makes sense to skip the added rules with "gofumpt -w .",
because more often than not code generators only obey gofmt,
and it's often unnecessary to force generated code to follow gofumpt.

The behavior is similar to how we treat vendor directories,
with the difference that we do fully skip vendor directories by default,
whereas for generated Go files we still apply gofmt.
The difference is that changing vendored files may upset cmd/go,
and walking the vendor directory can unnecessarily waste time.

While here, tweak the README to better explain these special cases.

Fixes #180.
@mvdan mvdan requested a review from tsnewaz February 20, 2022 12:42
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.

Make ignoring of Go files containing generated code optional
2 participants