- Mailing Lists
- Contributors
- New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
Archives
- By thread 1419
-
By date
- August 2019 59
- September 2019 118
- October 2019 165
- November 2019 97
- December 2019 35
- January 2020 58
- February 2020 204
- March 2020 121
- April 2020 172
- May 2020 50
- June 2020 158
- July 2020 85
- August 2020 94
- September 2020 193
- October 2020 277
- November 2020 100
- December 2020 159
- January 2021 38
- February 2021 87
- March 2021 146
- April 2021 73
- May 2021 90
- June 2021 86
- July 2021 123
- August 2021 50
- September 2021 68
- October 2021 66
- November 2021 74
- December 2021 75
- January 2022 98
- February 2022 77
- March 2022 68
- April 2022 31
- May 2022 59
- June 2022 87
- July 2022 141
- August 2022 38
- September 2022 73
- October 2022 152
- November 2022 39
- December 2022 50
- January 2023 93
- February 2023 49
- March 2023 106
- April 2023 47
- May 2023 69
- June 2023 92
- July 2023 64
- August 2023 103
- September 2023 91
- October 2023 101
- November 2023 94
- December 2023 46
- January 2024 75
- February 2024 79
- March 2024 104
- April 2024 63
- May 2024 40
- June 2024 160
- July 2024 80
- August 2024 70
- September 2024 62
- October 2024 121
- November 2024 117
- December 2024 89
- January 2025 59
- February 2025 104
- March 2025 96
- April 2025 107
- May 2025 52
- June 2025 72
- July 2025 60
- August 2025 81
- September 2025 124
- October 2025 63
- November 2025 22
Contributors
Translations done by a webservice
Tip: Always call `clean_action` when returning an `ir.actions.act_window`
New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
- create-user-wo-reset-password
- duplicate-xml-fields
- redundant-modulename-xml
- deprecated-data-xml-node
by Moisés López Calderón - 10:11 - 27 Jun 2022
Follow-Ups
-
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
On Mon, Jun 27, 2022 at 10:12 PM Moises Lopez <moylop260@vauxoo.com> wrote:Currently, we are using pylint-odoo project as pre-commit hooks for other kind of filesNow, we are using pre-commit for new projects.So we can remove all the checks unrelated with python from pylint-odooe.g. eslint (javascript lints), XML checks, PO (translations) checks and so onThen they could be replaced in the pre-commit configuration file with the id of the related checke.g. eslint see https://github.com/pre-commit/mirrors-eslintThere are other custom checks in pylint-odoo as unnecessary-utf8-coding-commentBut it is duplicated with the following hook id fix-encoding-pragma from:It even has the option to auto-fix itSimilar case for pylint-odoo check incoherent-interpreter-exec-perm:Similar case for pylint-odoo check wrong-tabs-instead-of-spacesThey are duplicated from pylint-odoo and they are better since they have the option to auto-fix if you want.But there are other kinds of custom checks in pylint-odoo unrelated with python files that could be good to create a new pre-commit-hook custom for Odoo modulesIn order to check XMLs, PO, CSS, CSV, and so on in the context of Odoo modules.Currently, pylint-odoo is overloaded trying to do checks for non-python code since the core is not supporting check non-python filesAnd pylint-odoo doesn't have the auto-fix optione.g. for XML files:- dangerous-filter-wo-user- duplicate-xml-record-id- deprecated-openerp-xml-node
- create-user-wo-reset-password
- duplicate-xml-fields
- redundant-modulename-xml
- deprecated-data-xml-nodee.g. for CSV files:- duplicate-id-csve.g. for PO files (Maybe, If we look for if exists hooks related to PO files they could be already developed from another hook project, so use it instead):- duplicate-po-message-definition- po-msgstr-variablesSo, IMHO in OCA we need to create a new project to push all these custom pre-commit hooks and add documentation of the useful projects replacing pylint-odoo checks.The name proposal is oca/odoo-pre-commit-hooks similar to main hooks repository:And we can (or not) enable the option to auto fix (we can even push checks without auto fix)Check the following discussion about creating custom repository to detect and autofix:Check the following discussion about deprecating duplicated checks if pre-commit supports:Check the following plan to create a freeze branch in pylint-odoo with the current behavior in pro to create a new version with new focus and clean code, delete old unused checks, deprecate py2 and so on:If you agree, Could you help us to create the repository in OCA, please?--Moisés López CalderónMobile: (+521) 477-752-22-30Twitter: @moylop260Twitter: @vauxoo_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Stéphane Bidoul - 11:15 - 29 Jun 2022 -
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
Hi Moises,Sounds great to make pylint-odoo simpler!I take the opportunity to mention the semgrep (https://semgrep.dev) project that I recently discovered and may be a simple solution to implement some checks.I'll create the new repo soon.> Question: how does this coordinate with the OCA repo template? Pre commit hooks are currently maintained there, right?Once the new checkers/fixers are ready in the new repo(s), they will need to be referenced in the .pre-commit-config.yaml template in the addons repo template.Best regards,-sbiOn Tue, Jun 28, 2022 at 9:52 AM Daniel Reis <dreis@opensourceintegrators.com> wrote:Thank you for taking care of this Moises.Question: how does this coordinate with the OCA repo template? Pre commit hooks are currently maintained there, right?--drNo dia 28/06/2022, às 07:46, Mignon, Laurent <laurent.mignon@acsone.eu> escreveu:
Good Idea!Regards.On Tue, Jun 28, 2022 at 8:17 AM Pedro M. Baeza (Tecnativa) <pedro.baeza@tecnativa.com> wrote:Yes, I agree.Regards._______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Stéphane Bidoul - 12:41 - 28 Jun 2022 -
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
I have done a big progress in this subject recently, and it's open sourced. Get it here: https://gitlab.com/moduon/devsecops/precommixIt's based on Nix, so you will never get another random failure. It's a definitive solution for problems such as:- https://github.com/OCA/oca-addons-repo-template/issues/133
- https://github.com/OCA/oca-addons-repo-template/pull/143
Your pre-commit configurations will keep working forever.Just go ahead and wire precommix with oca-addons-repo-template.Apart from that, I agree on removing the non-python stuff from pylint-odoo.
by Jairo Llopis - 11:16 - 28 Jun 2022 -
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
Great ! +1On Mon, Jun 27, 2022 at 10:12 PM Moises Lopez <moylop260@vauxoo.com> wrote:Currently, we are using pylint-odoo project as pre-commit hooks for other kind of filesNow, we are using pre-commit for new projects.So we can remove all the checks unrelated with python from pylint-odooe.g. eslint (javascript lints), XML checks, PO (translations) checks and so onThen they could be replaced in the pre-commit configuration file with the id of the related checke.g. eslint see https://github.com/pre-commit/mirrors-eslintThere are other custom checks in pylint-odoo as unnecessary-utf8-coding-commentBut it is duplicated with the following hook id fix-encoding-pragma from:It even has the option to auto-fix itSimilar case for pylint-odoo check incoherent-interpreter-exec-perm:Similar case for pylint-odoo check wrong-tabs-instead-of-spacesThey are duplicated from pylint-odoo and they are better since they have the option to auto-fix if you want.But there are other kinds of custom checks in pylint-odoo unrelated with python files that could be good to create a new pre-commit-hook custom for Odoo modulesIn order to check XMLs, PO, CSS, CSV, and so on in the context of Odoo modules.Currently, pylint-odoo is overloaded trying to do checks for non-python code since the core is not supporting check non-python filesAnd pylint-odoo doesn't have the auto-fix optione.g. for XML files:- dangerous-filter-wo-user- duplicate-xml-record-id- deprecated-openerp-xml-node
- create-user-wo-reset-password
- duplicate-xml-fields
- redundant-modulename-xml
- deprecated-data-xml-nodee.g. for CSV files:- duplicate-id-csve.g. for PO files (Maybe, If we look for if exists hooks related to PO files they could be already developed from another hook project, so use it instead):- duplicate-po-message-definition- po-msgstr-variablesSo, IMHO in OCA we need to create a new project to push all these custom pre-commit hooks and add documentation of the useful projects replacing pylint-odoo checks.The name proposal is oca/odoo-pre-commit-hooks similar to main hooks repository:And we can (or not) enable the option to auto fix (we can even push checks without auto fix)Check the following discussion about creating custom repository to detect and autofix:Check the following discussion about deprecating duplicated checks if pre-commit supports:Check the following plan to create a freeze branch in pylint-odoo with the current behavior in pro to create a new version with new focus and clean code, delete old unused checks, deprecate py2 and so on:If you agree, Could you help us to create the repository in OCA, please?--Moisés López CalderónMobile: (+521) 477-752-22-30Twitter: @moylop260Twitter: @vauxoo_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
--
by Denis Roussel - 10:51 - 28 Jun 2022 -
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
Thank you for taking care of this Moises.Question: how does this coordinate with the OCA repo template? Pre commit hooks are currently maintained there, right?--drNo dia 28/06/2022, às 07:46, Mignon, Laurent <laurent.mignon@acsone.eu> escreveu:
Good Idea!Regards.On Tue, Jun 28, 2022 at 8:17 AM Pedro M. Baeza (Tecnativa) <pedro.baeza@tecnativa.com> wrote:Yes, I agree.Regards._______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Daniel Reis - 09:51 - 28 Jun 2022