-
Notifications
You must be signed in to change notification settings - Fork 37
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
chore: update templates for cargo-generate 0.23.0 #95
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These suggestions would make this a much smaller change:
- exclude the github workflow files from generation
- override the author by environment as part of the just file
authors = ["Josh McKinney <[email protected].com>"] | ||
authors = ["Orhun Parmaksız <orhunparmaksiz@gmail.com>"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing we could do here instead to avoid this bouncing back and forth is to add some sort of env override in the just file that makes this consistent across runs.
(target: $target:expr, level: $level:expr, $ex:expr) => {{ | ||
(target: $target:expr, level: $level:expr, $ex:expr) => { | ||
{ | ||
match $ex { | ||
value => { | ||
tracing::event!(target: $target, $level, ?value, stringify!($ex)); | ||
value | ||
} | ||
} | ||
}}; | ||
} | ||
}; | ||
(level: $level:expr, $ex:expr) => { | ||
trace_dbg!(target: module_path!(), level: $level, $ex) | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indenting seems a bit weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdym
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8 spaces rather than 4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about instead excluding these files from being parsed by liquid? https://cargo-generate.github.io/cargo-generate/templates/include_exclude.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That didn't work for me via top-level cargo-generate.toml
. However IIRC it works with individual ones for each template which is not that good. Can you also give it a try?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for each template which is not that good
What's not good about configuring entire files to not be processed per template? This is instead of putting code around the parts of each file to avoid processing but there's nothing else being processed in that file. I may be missing the logic of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant adding the same cargo-generate.toml
for each template is not that good. I think it's better if we do that in the top-level config which didn't work for me.
I'll merge this as-is for now since it's affecting people and we can make the improvements later on |
See:
cargo-generate-action is not bumped yet: cargo-generate/cargo-generate-action#22