OpenSK icon indicating copy to clipboard operation
OpenSK copied to clipboard

Enable Rustfmt's wrap_comments option?

Open gendx opened this issue 3 years ago • 3 comments

As pointed out in https://github.com/google/OpenSK/pull/165#discussion_r499035911, we currently allow comments that exceed the maximum line length normally allowed by Rustfmt.

We could enable the wrap_comments option in rustfmt.toml to make sure the comments don't exceed this maximum length, and are wrapped properly. This however requires a few things.

  • The wrap_comments option is currently unstable (rust-lang/rustfmt#3347), so we have to decide if we want to commit to using it.
  • Enabling it will require some manual fixing of a few badly formatted comments, e.g. including ASCII art.

gendx avatar Oct 05 '20 12:10 gendx

As indicated, I expected this to automatically checked. No strong opinion however, where are ASCII art examples that would need refactoring?

kaczmarczyck avatar Oct 12 '20 08:10 kaczmarczyck

As indicated, I expected this to automatically checked. No strong opinion however, where are ASCII art examples that would need refactoring?

It'd be easier to have an exhaustive list while reviewing code, but for a start src/ctap/ctap1.rs has some tables (not sure if it should be best described as "ASCII art" or "markdown").

gendx avatar Oct 12 '20 16:10 gendx

Just wanted to know if you have an intuition about how much we have to change. But it seems like our code would be nicer with correct length comments? But I'd say it's low priority.

kaczmarczyck avatar Oct 12 '20 16:10 kaczmarczyck