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

Put codegen output into OUT_DIR rather than src/ #76

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

liamkinne
Copy link

The current guidance of putting code generated by a build.rs script into src/ is generally not a good idea (see here). It leads to it being checked into source control and people trying to make edits to it.

Trying to put the current output of codegen into OUT_DIR causes errors to do with inner attributes not being permitted. This PR implements a config parameter clippy_attributes which turns off generating these attributes by default. They are turned back on for the CLI as it is assumed the user will be placing the output into src/ in that case.

Also see prost_build for a good template for how code generation from an interface format should work.

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.

1 participant