BurntSushi / ucd-generate

A command line tool to generate Unicode tables as source code.
Apache License 2.0
93 stars 21 forks source link

Option to emit attribute to disable rustfmt #18

Open danielparks opened 4 years ago

danielparks commented 4 years ago

Depending on how rustfmt is configured, it may try to reformat ucd-generate output. Add an option to emit #![rustfmt::skip] at the top of files created by ucd-generate so that rustfmt knows to skip them.

See https://github.com/rust-lang/regex/issues/634 for an example where files generated by ucd-generate don’t match rustfmt’s configuration, which cause CI failures.

BurntSushi commented 4 years ago

I'm in favor of adding this, but this really isn't causing the CI failures. This is just kind of one of the hazards of putting a rustfmt check in CI. rustfmt evolves even if the code doesn't. Generated code is just as susceptible to this as regular code. Indeed, in regex's case, some hand-written files were also bitten by this.