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

Include @generated in generated schema to help rustfmt skip it #2454

Closed
2 tasks done
wezm opened this issue Jul 11, 2020 · 0 comments · Fixed by #2462
Closed
2 tasks done

Include @generated in generated schema to help rustfmt skip it #2454

wezm opened this issue Jul 11, 2020 · 0 comments · Fixed by #2462

Comments

@wezm
Copy link

wezm commented Jul 11, 2020

A feature was recently merged into rustfmt that makes it aware of @generated. This is an informal convention that tools can use to recognise generated files. This issue in the rustfmt repo discusses other tools that include or recoginse @generated. Notably Cargo includes it in a comment at the top of Cargo.lock:

# This file is automatically @generated by Cargo.
# It is not intended for manual editing.

It would be convenient if the schema.rs generated by diesel_cli included this text in a comment at the top of the file so that rustfmt will skip it, avoiding churn/manually reverting the changes made by cargo fmt.

Checklist

  • I have already looked over the issue tracker for similar issues.
  • This issue can be reproduced on Rust's stable channel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants