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

Fix #3961 : use char range methods (not byte offsets) to detect whitespace #6764

Closed

Conversation

pnkfelix
Copy link
Member

Fix for #3961. Also includes a test case to illustrate the issues. (All of the entries that say "should align" should align with each other, and the four lines near the end that say "compare _" for _ in {A,B,C,D} should line up with each other.)

Before applying this change set:
-- the "(should align)"'s are all over the place, and the form/line feeding spaces are not cut out as one might or might not expect.
-- compare B and D do not match A and C.

(To be honest, its hard to really say what the right behavior is here, and people who are expecting a particular behavior out of a pretty printer in these cases may well get burned.)

@pnkfelix
Copy link
Member Author

@catamorphism hmm, I had seen that some of the files in test/pretty/ had the pp-exact directive, but I did not see it in all of the tests.
Is it supposed to mean that the output from the pretty-printer is supposed to match the input? (If so, then it would be wrong to add it here, because the output definitely does not match the input in this case.)

@pnkfelix
Copy link
Member Author

(in other words, I do not know what pp-exact checks either, and would like to learn more. :)

@pnkfelix
Copy link
Member Author

From discussion with graydon and niko, determined that pp-exact would not be the right thing for this "test case", such as it is, because the output is not expected to match the input here.

There may be a way to specify a separate output file that needs to be matched. I'll look it see if I can find that and use it.

@pnkfelix
Copy link
Member Author

ah maybe pp-exact:output.pp is what I want.

@pnkfelix
Copy link
Member Author

@brson r?

@graydon graydon closed this Jun 13, 2013
bors added a commit that referenced this pull request Jun 16, 2013
…n, r=brson

r?  (yes, the review request is back, now that I got it building against incom... I mean master!)

(Attempting to port from orphaned pull-request #6764 )

Fix for #3961. Also includes a test case to illustrate the issues. (All of the entries that say "should align" should align with each other, and the four lines near the end that say "compare _" for _ in {A,B,C,D} should line up with each other.)

Before applying this change set:
-- the "(should align)"'s are all over the place, and the form/line feeding spaces are not cut out as one might or might not expect.
-- compare B and D do not match A and C.

(To be honest, its hard to really say what the right behavior is here, and people who are expecting a particular behavior out of a pretty printer in these cases may well get burned.)
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 25, 2021
…p1995

lintcheck: parallelize

By default we use a single thread and one target dir as before.

If `-j n` is passed, use `n` target dirs and run one clippy in each of them.
We need several target dirs because cargo would lock them for a single process otherwise which would prevent the parallelism.
`-j 0` makes rayon use  $thread_count/2 (which I assume is the number of physical cores of a machine) for the number of threads.

Other change:
Show output of clippy being compiled when building it for lintcheck (makes it easier to spot compiler errors etc)
Show some progress indication in the "Linting... foo 1.2.3"  message.
Sort crates before linting (previously crates would be split randomly between target dirs, with the sorting, we try to make sure that even crates land in target dir 0 and odd ones in target dir 1 etc..)

*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: parallelize lintcheck with rayon
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.

2 participants