rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Filter out block comment in filter_normal_code if configured to use rustfmt 2 (#4668)

Open ChinYing-Li opened this issue 4 years ago • 5 comments

Back-port the fix (#4720) to rustfmt 1.x; In order to version-gate in LineClasses, several function signature had been changed:

  • wrap_str
  • filter_normal_code

Should we add the idempotent test cases as well?

ChinYing-Li avatar Mar 17 '21 06:03 ChinYing-Li

itemize_list

Yes please!

calebcartwright avatar Mar 17 '21 22:03 calebcartwright

I didn't see version gating in other idempotent tests, so I am thinking about creating a standalone set of test cases that use a Config file whose version is Version:Two. Please let me know if you recommend doing this the other way.

ChinYing-Li avatar Mar 17 '21 22:03 ChinYing-Li

I didn't see version gating in other idempotent tests, so I am thinking about creating a standalone set of test cases that use a Config file whose version is Version:Two

There's actually a much simpler to specify configuration values in the files used for the system+idempotence tests, just add comments to the top of the files as needed of the form // rustfmt-{option name}: {value}

e.g. https://github.com/rust-lang/rustfmt/blob/c3a51111061e65a08ebce05c42e0d89ee1fae83a/tests/source/issue-3302.rs#L1

More info can be found in this section of the Contributing guide.

calebcartwright avatar Mar 17 '21 23:03 calebcartwright

Thank you! This looks good to go, though I haven't decided whether I want to pull it into the 1.4.37 release just yet so may hold off on merging for a little while.

There are plenty of other cases where we need to do a similar backporting, as well as general issues/feature requests on the backlog, so if you're interested in working on anything else please let me know and/or drop a note on the corresponding issue!

calebcartwright avatar Mar 21 '21 19:03 calebcartwright

@ChinYing-Li maybe you could push the branch again to re-trigger the CI so it might become green?

Other than that, since 1.4.37 has been released a while ago... :)

karyon avatar Oct 22 '21 14:10 karyon