cnpryer / huak

My experimental Python package manager.
https://cnpryer.github.io/huak/
MIT License
616 stars 34 forks source link

Clean up parameters order in cli.rs #864

Closed cnpryer closed 10 months ago

cnpryer commented 11 months ago

I noticed that in cli.rs (huak-cli crate) there is no formal structure to some of these function signatures. For example some functions will lead with the configuration data:

fn function(config: &Config, param1: Something) -> HuakResult<()> {
}

Others might have Config between other parameters:

fn function(param1: Something, config: &Config, param2: Something) -> HuakResult<()> {
}

And others have Config follow the rest of the parameters:

fn function(param1: Something, config: &Config) -> HuakResult<()> {
}

It'd be nice to structure this module a bit better. Either [a-z] for command parameters and end with Config or order the rest of the parameters by what feels natural for that command. Either way I think Config data should be last.