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

Allow specifying preprocessor order #1607

Merged
merged 4 commits into from
Oct 3, 2021
Merged

Conversation

ISSOtm
Copy link
Contributor

@ISSOtm ISSOtm commented Jul 21, 2021

Fixes #1172

@ISSOtm
Copy link
Contributor Author

ISSOtm commented Jul 21, 2021

I've determined that the order in which preprocessors are run is non-deterministic (blame topological-sort), and that makes one of the tests randomly fail since it expects an exact order.

The question then is: is this acceptable?

@ehuss
Copy link
Contributor

ehuss commented Sep 26, 2021

Thanks! I think it would be ideal if the order would be at least stable. Would it be possible to sort the preprocessors by name?

@ISSOtm
Copy link
Contributor Author

ISSOtm commented Sep 26, 2021

Sure, I'll see about stabilizing ties.

@ISSOtm
Copy link
Contributor Author

ISSOtm commented Sep 26, 2021

Should it be made a contract in the documentation, or should we specify that ties are guaranteed to be identically resolved across runs but not across versions?

@ISSOtm
Copy link
Contributor Author

ISSOtm commented Sep 26, 2021

Additionally, do we match, or ignore case?

@ehuss
Copy link
Contributor

ehuss commented Sep 26, 2021

I think mentioning that they are otherwise sorted by name would be fine.
I wouldn't worry about ignoring case, just doing a normal string comparison would be fine.

@ISSOtm
Copy link
Contributor Author

ISSOtm commented Sep 26, 2021

So sticking with the default string sorting should be enough, right?

@ehuss
Copy link
Contributor

ehuss commented Sep 26, 2021

Yea, the default string sort should be good.

@ISSOtm
Copy link
Contributor Author

ISSOtm commented Sep 26, 2021

Okay, I updated the test to expect index before links, and the documentation using your almost exact wording. Ready for review!

guide/src/format/configuration/preprocessors.md Outdated Show resolved Hide resolved
src/book/mod.rs Outdated Show resolved Hide resolved
src/book/mod.rs Show resolved Hide resolved
@ISSOtm
Copy link
Contributor Author

ISSOtm commented Sep 28, 2021

Done!

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ehuss ehuss merged commit 0d88750 into rust-lang:master Oct 3, 2021
@ISSOtm ISSOtm deleted the preproc-order branch October 4, 2021 09:48
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.

[feature] I'd like to specify the order of preprocessors
2 participants