[IMP] allow fix_manifest_website.py to fix only specified manifest files#522
[IMP] allow fix_manifest_website.py to fix only specified manifest files#522pasculorente wants to merge 1 commit intoOCA:masterfrom
Conversation
- fix_manifest_website.py gets a new variadic argument [manifest] - if the argument is specified, only these manifests are fixed
3dc0a39 to
086831f
Compare
|
Hello @pedrobaeza how are you? who can I ping for this kind of tasks? Thank you |
|
Hi, Pascual, It's difficult, as the maintainers of these tools are very few. Specifically this one, it has been contributed only by @sbidoul . Maybe he can take a look, but I'm not sure if it's intended that this check (and automatic change) is intended for the whole repo. P.S.: I'm curious. You have put in your GH profile that your organization is Odoo S.A. Are you really working there? Is Odoo S.A. interested in these tools? |
|
Hi @pedrobaeza Thanks for your quick reply. Yes, in our development pipeline we are using this specific script as a pre-commit hook. It's very handy :) |
|
That's cool! I hope more synergies can be set between Odoo SA and OCA in the tooling. |
|
In which team do you work? |
|
Hi @pasculorente thanks for the contrib. Generally LGTM, just a couple of minor usability remarks. |
|
Thanks @sbidoul . @pedrobaeza I'm part of the Professional Service Team in Odoo. I'll gladly contribute to this tools, however, I can only do it as a personal contribution. |
Eh eh, want me to talk to your boss to explain the value of contributing back to open source projects 😉 ? Thanks for contributing in any case! |
Where are the remarks? |
|
|
||
| @click.command() | ||
| @click.argument("url") | ||
| @click.argument("manifest", nargs=-1, type=click.Path()) |
There was a problem hiding this comment.
| @click.argument("manifest", nargs=-1, type=click.Path()) | |
| @click.argument("manifest", nargs=-1, type=click.Path(exists=True)) |
| @click.command() | ||
| @click.argument("url") | ||
| @click.argument("manifest", nargs=-1, type=click.Path()) | ||
| @click.option("--addons-dir", default=".") |
There was a problem hiding this comment.
It would be nice to have some help text saying that --addons-dir and manifests are mutually exclusive, and raise an error rather than ignoring silently.
There was a problem hiding this comment.
Thanks @sbidoul your comments are helpful. I will address them later and ping you back.
Fixes / new features
The target of this PR is to improve the experience with the pre-commit hook. Right now, fix_manifest_website.py modifies all manifests under addons_dir. However, when using pre-commit, the expected behavior is that only files part of the commit are modified. Since pre-commit passes the list of files as a variadic argument, we can easily capture this list.
This PR delegates the filtering of the manifest files to the hook, expecting a configuration of the hook similar to:
Luckily, this configuration will call the script with the arguments:
--addons_dir . https://odoo.com module_a/__manifest__.py