-
Notifications
You must be signed in to change notification settings - Fork 96
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
postprocessors #383
postprocessors #383
Conversation
Can you add a line in the Readme about the bash dependency checker? There is already one about shfmt. |
I want to report that clippy is warning about some function unused. |
…be more explanatory
@hdwalters do the review thing again |
src/compiler/postprocess.rs
Outdated
pub fn get_default() -> Vec<Self> { | ||
let mut postprocessors = Vec::new(); | ||
|
||
let shfmt = PostProcessor::new("shfmt", "/usr/bin/shfmt"); |
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.
Here you're creating both processors, and then immediately removing them according to the CLI options; this is inelegant. Surely it would be better to combine get_default()
and filter_default()
, and only create the processors you're actually going to need:
pub fn get_processors(filters: Vec<WildMatchPattern<'*', '?'>>) -> Vec<Self> {
let mut processors = Vec::new();
if Self::filter_processor(&filters, "shfmt") {
// Add "shfmt"
}
if Self::filter_processor(&filters, "bshchk") {
// Add "bshchk"
}
processors
}
I suspect you did it this way so you could call get_default()
in the integration tests, but you could always call this new function with an empty vector:
let default = PostProcessor::get_processors(Vec::new());
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 is inelegant; Surely it would be better to combine
get_default()
andfilter_default()
, and only create the processors you're actually going to need:
why? its still the same two functions but now it breaks DRY and a little bit more dirty. there are no issues with the current setup
@Ph0enixKM do review!!!!! we're waiting for u |
He did say "I'll be unavailable for checking PRs starting from today [30/10] until 3/11 too" |
For some reason, GitHub is not giving me the option to clone this branch using Git; it only suggests However, since @b1ek has now rewritten this code, and removed the |
this removes code from #128 and closes #377, #149, #107, #95
the implementation is no different than the one from #128, but it also can be defined as a serializeable schema in case we want to make some sort of a config file for those.
closes #476, #377, #149, #107, #95