Contributors mailing list archives
contributors@odoo-community.org
Browse archives
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
by
Serpent Consulting Services, Jay Vora
Excellent work man!
+1 for repo.
On Tue, Jun 28, 2022 at 1:42 AM 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
Technology Services @ www.serpentcs.com
Business Solutions @ www.serpentcs.in
Enterprise Mobile Apps @ www.odooonline.com
Quality Assurance @ www.odooqa.com
SAP Hana @ www.prozone-tech.com
Portal & DMS @ www.alfray.in
Regards,
----------------------------------------------------------------------------------------------------------------------------
| |||||||||||||||
------------------------------------------------------------------------------------------------- Visit our website : http://www.serpentcs.com | |||||||||||||||
Reference
-
New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
byVauxoo, Moisés López Calderón-
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
byAcsone SA/NV, Stéphane Bidoul -
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
byAcsone SA/NV, Stéphane Bidoul -
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
byModuon Team, S. L., Jairo Llopis -
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
byAcsone SA/NV, Denis Roussel -
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
byClosingAp Open Source Integrators Europe, LDA, Daniel Reis -
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
byAcsone SA/NV, Laurent Mignon -
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
byTecnativa. S. L., Pedro M. Baeza -
Re: New repository oca/odoo-pre-commit-hooks and pylint-odoo deep refactoring
bySerpent Consulting Services, Jay Vora
-