-
-
Notifications
You must be signed in to change notification settings - Fork 461
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
[IMP] allow fix_manifest_website.py to fix only specified manifest files #522
base: master
Are you sure you want to change the base?
[IMP] allow fix_manifest_website.py to fix only specified manifest files #522
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? |
@@ -12,36 +13,53 @@ | |||
|
|||
@click.command() | |||
@click.argument("url") | |||
@click.argument("manifest", nargs=-1, type=click.Path()) |
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.
@click.argument("manifest", nargs=-1, type=click.Path()) | |
@click.argument("manifest", nargs=-1, type=click.Path(exists=True)) |
@@ -12,36 +13,53 @@ | |||
|
|||
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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