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

Rustfmt macros #22

Merged
merged 2 commits into from
Dec 25, 2018
Merged

Rustfmt macros #22

merged 2 commits into from
Dec 25, 2018

Conversation

doitian
Copy link
Contributor

@doitian doitian commented Dec 25, 2018

Script rustfmt-quote.py is stupid but it works.

I have tried to write it in Bash, but it is too slow. The reason to choose Python is that it is built-in in most system.

The script first extracts the code between quote! and replace the macro variables in it.

Then it surrounds the code in the correct context, and run rustfmt against it.

However, some macro code still fails to pass rustfmt, so a blacklist is used to skip these kinds of code.

Script `rustfmt-quote.py` is stupid but it works.

I have tried to write it in Bash, but it is too slow. The reason to choose
Python is that it is built-in in most system.

The script first extracts the code between `quote!` and replace the macro variables
in it.

Then it surrounds the code in the correct context, and run `rustfmt` against
it.

However, some macro code still fails to pass `rustfmt`, so a blacklist is used to skip these kinds of code.
@chaoticlonghair chaoticlonghair merged commit 5f1e9d4 into cryptape:develop Dec 25, 2018
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