Closed moylop260 closed 2 years ago
We need 3 ways to configure arguments parameter to hooks
1) hook.py --param1 2) os.environ.get(param1) 3) config_file.cfg param1 4) default value
The priority should be in the same order
I mean, the parameter in the shell overwrite the other 3
I'm not sure about os.environment vs configuration file but you could define the same way than https://click.palletsprojects.com/en/8.1.x/
Disclaimer: Don't use click, only the same criteria
I think it should be
parser(default=os.environ.get("VARIABLE", DEFAULT_VALUE)
https://github.com/OCA/odoo-pre-commit-hooks/blob/710c295aeae768877d51120904ba0a2072a7dba6/src/oca_pre_commit_hooks/cli.py#L42
Starting to work on this.
We need 3 ways to configure arguments parameter to hooks
1) hook.py --param1 2) os.environ.get(param1) 3) config_file.cfg param1 4) default value
The priority should be in the same order
I mean, the parameter in the shell overwrite the other 3
I'm not sure about os.environment vs configuration file but you could define the same way than https://click.palletsprojects.com/en/8.1.x/
Disclaimer: Don't use click, only the same criteria
I think it should be
parser(default=os.environ.get("VARIABLE", DEFAULT_VALUE)
https://github.com/OCA/odoo-pre-commit-hooks/blob/710c295aeae768877d51120904ba0a2072a7dba6/src/oca_pre_commit_hooks/cli.py#L42