Package: oca-odoo-pre-commit-hooks
odoo-pre-commit-hooksOCA's custom pre-commit hooks for Odoo modulesInstallationYou don't need to install it directly only configure your ".pre-commit-config.yaml" fileYou even can install it directly:Installing from pypi:pip install -U oca-odoo-pre-commit-hooksInstalling from github:pip install --force-reinstall -U git+https://github.com/OCA/odoo-pre-commit-hooks.git@mainUsage pre-commit-config.yamlAdd to your ".pre-commit-config.yaml" configuration file the following input-repo:https://github.com/OCA/odoo-pre-commit-hooksrev:v0.0.30hooks:-id:oca-checks-odoo-module-id:oca-checks-poargs:["--fix"]Usage directly the entry pointsIf you install directly the package use the entry point:oca-checks-odoo-module --help
oca-checks-po --helpSkip one xml-check for only one fileIf you need to skip one check in one particular XML file you can use the follow comment<?xml version="1.0" encoding="utf-8"?><!-- oca-hooks:disable=xml-check-to-skip --><odoo>...</odoo><?xml version="1.0" encoding="utf-8"?><!-- oca-hooks:disable=xml-check-to-skip,xml-check-to-skip2 --><odoo>...</odoo>The position of the comment it is not relative to the line that throw the checkIt disable the entire fileConfigurationBehavior can be configured through several methods and as of now only consists of enabling/disabling checks.Enabling or Disabling ChecksEach available hook consists of multiple checks which can be enabled/disabled using any of the following methods (ordered by priority):As an argument e.g.,oca-checks-odoo --enable=check-to-enable --disable=check-to-disable1,check-to-disable2Using environment variablesOCA_HOOKS_ENABLEorOCA_HOOKS_DISABLEe.g.,export OCA_HOOKS_ENABLE=check1,check2A configuration file. The path to it can be specified with the argument--config. Alternatively a file named.oca_hooks.cfgwill be looked for (by default) in the following locations (in order):Current working directoryRepo's rootUser's homeUsing a Configuration FileTo enable or disable checks using a configuration file, add adisableorenablekey under theMESSAGES_CONTROLsection.
For example:[MESSAGES_CONTROL]
enable=check-enable1,check-enable2
disable=check-to-disableAs stated before, each source has a certain priority. This means that if the environment variableOCA_HOOKS_ENABLE=check1exists, the configuration file above would not have any effect when it comes to enabling checks, and the only enabled
check will becheck1.However, ifOCA_HOOKS_DISABLEis not set, the configuration file will still have an effect andcheck-to-disablewill
be disabled.ChecksCheck manifest-syntax-error
Check if the manifest file has syntax errorCheck csv-duplicate-record-id
duplicate CSV "id" AKA xmlid but for CSV filesCheck csv-syntax-error
Check syntax error for CSV files declared in the manifestCheck xml-deprecated-data-node
Deprecated  node inside  xml nodeCheck xml-deprecated-openerp-node
deprecated  xml nodeCheck xml-deprecated-qweb-directive
for use of deprecated QWeb directives t-*-optionsCheck xml-not-valid-char-link
The resource in in src/href contains a not valid character.Check xml-oe-structure-missing-idEnsure all tags with class 'oe_structure' have an ID. For more information on the rationale, see:
  https://github.com/OCA/odoo-pre-commit-hooks/issues/27Check xml-redundant-module-nameIf the module is called "module_a" and the xmlid is
  `<record id="module_a.xmlid_name1" ...`

  The "module_a." is redundant it could be replaced to only
  `<record id="xmlid_name1" ...`Check xml-dangerous-filter-wo-user
Check dangerous filter without a user assigned.Check xml-create-user-wo-reset-password
records of user withoutcontext="{'no_reset_password': True}"This context avoid send email and mail log warningCheck xml-view-dangerous-replace-low-priority in ir.ui.view<field name="priority" eval="10"/>
      ...
          <field name="name" position="replace"/>Check xml-deprecated-tree-attribute
The tree-view declaration is using a deprecated attribute.Check xml-record-missing-id
Generated when a  tag has no id.Check xml-duplicate-record-idIf a module has duplicated record_id AKA xml_ids
  file1.xml
      <record id="xmlid_name1"
  file2.xml
      <record id="xmlid_name1"Check xml-duplicate-fields in all record nodes
<record id="xmlid_name1"...
<field name="field_name1"...
<field name="field_name1"...Check xml-syntax-error
Check syntax of XML files declared in the Odoo manifestCheck xml-dangerous-qweb-replace-low-priority
Dangerous qweb view defined with low priorityCheck xml-duplicate-template-id
Triggered when two templates share the same IDCheck xml-xpath-translatable-item checkxpathnodes usingcontains(text(), 'Text translatable')Since that the text could be translated so it is a mutable value.
It could raiseValueErrorexception if the language is changed.Checks POCheck po-requires-module
Translation entry requires comment#. module: MODULECheck po-python-parse-printf
Check ifmsgidis usingstrvariables like%sSo translationmsgstrmust be the same number of variables tooCheck po-python-parse-format
Check ifmsgidis usingstrvariables like{}So translationmsgstrmust be the same number of variables tooCheck po-duplicate-message-definition (message-id)
in all entries of PO filesCheck po-duplicate-model-definition
Verify that no entries share the same 'model:' tagCheck po-pretty-format
Check the following:
1. Entries sorted alphabetically
2. Lines are wrapped at 78 columns (same as Odoo)
3. Clear msgstr when it is the same as msgidCheck po-syntax-error
Check syntax of PO files from i18n* foldersHelpusage:oca-checks-odoo-module[-h][--no-verbose][--no-exit][--disableDISABLE][--enableENABLE][--configCONFIG][--list-msgs][--fix][files_or_modules...]positionalarguments:files_or_modulesOdoo__manifest__.pypathsorOdoomodulepaths.

options:-h,--helpshowthishelpmessageandexit--no-verboseIfenabledsodisableverbosemode.--no-exitIfenabledsoitwillnotcallexit.--disableDISABLE,-dDISABLEDisablethecheckerwiththegiven'check-name',separatedbycommas.--enableENABLE,-eENABLEEnablethecheckerwiththegiven'check-name',separatedbycommas.Default:Allchecksareenabledbydefault--configCONFIG,-cCONFIGPathtoaconfigurationfile(default:.oca_hooks.cfg)--list-msgsListallcurrentlyenabledmessages.--fixAutomaticallyfixfileswhenpossibleHelp POusage:oca-checks-po[-h][--no-verbose][--no-exit][--disableDISABLE][--enableENABLE][--configCONFIG][--list-msgs][--fix][po_files...]positionalarguments:po_filesPOfiles.

options:-h,--helpshowthishelpmessageandexit--no-verboseIfenabledsodisableverbosemode.--no-exitIfenabledsoitwillnotcallexit.--disableDISABLE,-dDISABLEDisablethecheckerwiththegiven'check-name',separatedbycommas.--enableENABLE,-eENABLEEnablethecheckerwiththegiven'check-name',separatedbycommas.Default:Allchecksareenabledbydefault--configCONFIG,-cCONFIGPathtoaconfigurationfile(default:.oca_hooks.cfg)--list-msgsListallcurrentlyenabledmessages.--fixAutomaticallyfixfileswhenpossibleExamplescsv-duplicate-record-idhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/ir.model.access.csv#L5Duplicate CSV record id "data/access_account_account_type" in test_repo/broken_module/ir.model.access.csv:6csv-syntax-errorhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/syntax_err_module/ir.model.access.csv#L1'utf-8' codec can't decode byte 0xf1 in position 47: invalid continuation bytemanifest-syntax-errorhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/manifest_werror/__manifest__.py#L1could not be loaded manifest malformedhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/woinit_module/__manifest__.py#L1could not be loadedxml-create-user-wo-reset-passwordhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/res_users.xml#L10record res.users withoutcontext="{'no_reset_password': True}"xml-dangerous-filter-wo-userhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view_odoo.xml#L60Dangerous filter without explicituser_idxml-dangerous-qweb-replace-low-priorityhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1.xml#L18Dangerous use of "replace" from view with priority0 < 99. Only replace as a last resort. Try position="attributes", position="move" or t-if="False" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1.xml#L4Dangerous use of "replace" from view with priority0 < 99. Only replace as a last resort. Try position="attributes", position="move" or t-if="False" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1.xml#L7Dangerous use of "replace" from view with priority0 < 99. Only replace as a last resort. Try position="attributes", position="move" or t-if="False" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1_copy.xml#L18Dangerous use of "replace" from view with priority0 < 99. Only replace as a last resort. Try position="attributes", position="move" or t-if="False" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1_copy.xml#L4Dangerous use of "replace" from view with priority0 < 99. Only replace as a last resort. Try position="attributes", position="move" or t-if="False" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1_copy.xml#L7Dangerous use of "replace" from view with priority0 < 99. Only replace as a last resort. Try position="attributes", position="move" or t-if="False" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1_copy2.xml#L18Dangerous use of "replace" from view with priority0 < 99. Only replace as a last resort. Try position="attributes", position="move" or t-if="False" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1_copy2.xml#L4Dangerous use of "replace" from view with priority0 < 99. Only replace as a last resort. Try position="attributes", position="move" or t-if="False" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1_copy2.xml#L7Dangerous use of "replace" from view with priority0 < 99. Only replace as a last resort. Try position="attributes", position="move" or t-if="False" firstxml-deprecated-data-nodehttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/demo/duplicated_id_demo.xml#L3Use<odoo>instead of<odoo><data>or use<odoo noupdate="1">instead of<odoo><data noupdate="1">https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view.xml#L3Use<odoo>instead of<odoo><data>or use<odoo noupdate="1">instead of<odoo><data noupdate="1">https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view2.xml#L3Use<odoo>instead of<odoo><data>or use<odoo noupdate="1">instead of<odoo><data noupdate="1">https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view_odoo.xml#L3Use<odoo>instead of<odoo><data>or use<odoo noupdate="1">instead of<odoo><data noupdate="1">https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view_odoo2.xml#L3Use<odoo>instead of<odoo><data>or use<odoo noupdate="1">instead of<odoo><data noupdate="1">https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/skip_xml_check.xml#L5Use<odoo>instead of<odoo><data>or use<odoo noupdate="1">instead of<odoo><data noupdate="1">https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/skip_xml_check_2.xml#L3Use<odoo>instead of<odoo><data>or use<odoo noupdate="1">instead of<odoo><data noupdate="1">https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/model_view.xml#L3Use<odoo>instead of<odoo><data>or use<odoo noupdate="1">instead of<odoo><data noupdate="1">xml-deprecated-openerp-nodehttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view.xml#L2Deprecated  xml nodehttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view2.xml#L2Deprecated  xml nodehttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/model_view.xml#L2Deprecated  xml nodehttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/res_users.xml#L2Deprecated  xml nodexml-deprecated-qweb-directivehttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L20Deprecated QWeb directive"t-field-options". Use"t-options"insteadhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L7Deprecated QWeb directive"t-esc-options". Use"t-options"insteadxml-deprecated-tree-attributehttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view_odoo.xml#L31Deprecated "<tree string=..."https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view_odoo.xml#L42Deprecated "<tree colors=..."https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view_odoo.xml#L53Deprecated "<tree fonts=..."xml-duplicate-fieldshttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view_odoo2.xml#L19Duplicate xml field "model" in lines 20https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view_odoo2.xml#L6Duplicate xml field "name" in lines 13https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view_odoo2.xml#L74Duplicate xml field "arch" in lines 77xml-duplicate-record-idhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view.xml#L5Duplicate xml record id "data/view_model_form_noupdate_0" in test_repo/broken_module/model_view_odoo.xml:5, test_repo/broken_module/model_view_odoo2.xml:5https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view2.xml#L5Duplicate xml record id "data/view_model_form2_noupdate_0" in test_repo/broken_module/model_view_odoo2.xml:17xml-duplicate-template-idhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1.xml#L10Duplicate xml template id "qweb/my_template2_noupdate_0" in test_repo/broken_module/template1_copy2.xml:10https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1.xml#L17Duplicate xml template id "qweb/my_template3_noupdate_0" in test_repo/broken_module/template1_copy2.xml:17https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1.xml#L21Duplicate xml template id "qweb/my_template4_noupdate_0" in test_repo/broken_module/template1_copy2.xml:21https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1.xml#L25Duplicate xml template id "qweb/my_template5_noupdate_0" in test_repo/broken_module/template1_copy2.xml:25https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1.xml#L29Duplicate xml template id "qweb/my_duplicate_template_noupdate_0" in test_repo/broken_module/template1.xml:33https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1.xml#L3Duplicate xml template id "qweb/my_template1_noupdate_0" in test_repo/broken_module/template1_copy2.xml:3https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L18Duplicate xml template id "data/test_template_2_noupdate_0" in test_repo/test_module/website_templates_disable.xml:14https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L36Duplicate xml template id "data/assets_backend_noupdate_0" in test_repo/test_module/website_templates_disable.xml:24https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L5Duplicate xml template id "data/test_template_1_noupdate_0" in test_repo/test_module/website_templates_disable.xml:7xml-not-valid-char-linkhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L39The resource in in src/href contains a not valid characterhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L41The resource in in src/href contains a not valid characterxml-oe-structure-missing-idhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L13Consider removing the class 'oe_structure' or adding a proper id to the tag. The id must contain 'oe_structure'https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L24Consider removing the class 'oe_structure' or adding a proper id to the tag. The id must contain 'oe_structure'https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L27Consider removing the class 'oe_structure' or adding a proper id to the tag. The id must contain 'oe_structure'https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L30Consider removing the class 'oe_structure' or adding a proper id to the tag. The id must contain 'oe_structure'https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates.xml#L9Consider removing the class 'oe_structure' or adding a proper id to the tag. The id must contain 'oe_structure'https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/website_templates_disable.xml#L21Consider removing the class 'oe_structure' or adding a proper id to the tag. The id must contain 'oe_structure'xml-record-missing-idhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view.xml#L21Record has no id, add a unique one to create a new record, use an existing one to update ithttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view.xml#L24Record has no id, add a unique one to create a new record, use an existing one to update itxml-redundant-module-namehttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view2.xml#L15Redundant module name<record id="broken_module.view_model_form2"better using only<record id="view_model_form2"xml-syntax-errorhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/file_no_exist.xml#L1[Errno 2] No such file or directory: ''https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/file_no_exist.xml#L1[Errno 2] No such file or directory: ''xml-view-dangerous-replace-low-priorityhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view2.xml#L108Dangerous use of "replace" from view with priority 10 < 99. Only replace as a last resort. Try position="attributes", position="move" or invisible="1" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view2.xml#L25Dangerous use of "replace" from view with priority 0 < 99. Only replace as a last resort. Try position="attributes", position="move" or invisible="1" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view2.xml#L37Dangerous use of "replace" from view with priority 0 < 99. Only replace as a last resort. Try position="attributes", position="move" or invisible="1" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view2.xml#L47Dangerous use of "replace" from view with priority 0 < 99. Only replace as a last resort. Try position="attributes", position="move" or invisible="1" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view2.xml#L70Dangerous use of "replace" from view with priority 10 < 99. Only replace as a last resort. Try position="attributes", position="move" or invisible="1" firsthttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view2.xml#L92Dangerous use of "replace" from view with priority 10 < 99. Only replace as a last resort. Try position="attributes", position="move" or invisible="1" firstxml-xpath-translatable-itemhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/model_view.xml#L11Use of translatable xpathtext()https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1.xml#L39Use of translatable xpathtext()https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1_copy.xml#L31Use of translatable xpathtext()https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/template1_copy2.xml#L31Use of translatable xpathtext()Examples POpo-duplicate-message-definitionhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L17Duplicate PO message definition "Branch" in lines 23, 29https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L35Duplicate PO message definition "Message id toooooooooooooooooooooooooooo..." in lines 41https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L65Duplicate PO message definition "One variable {variable1}" in lines 71po-duplicate-model-definitionhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L17Translation for model:ir.model.fields,field_description:broken_module.field_wizard_description has been defined more than once in line(s) 29https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L35Translation for model:ir.model.fields,field_description2:broken_module.field_wizard_description2 has been defined more than once in line(s) 41https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L59Translation for model:ir.model.fields,field_description5:broken_module.field_wizard_description5 has been defined more than once in line(s) 65https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/i18n/fr.po#L24Translation for model:ir.model.fields,field_description2:test_module.field_description2 has been defined more than once in line(s) 24https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/i18n/fr.po#L31Translation for model:ir.model.fields,field_description5:test_module.field_description5 has been defined more than once in line(s) 31https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/i18n/fr.po#L38Translation for model:ir.model.fields,field_description3:test_module.field_description3 has been defined more than once in line(s) 38https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/i18n/fr.po#L45Translation for model:ir.model.fields,field_description4:test_module.field_description4 has been defined more than once in line(s) 45po-pretty-formathttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/ar_unicode.pois not formatted correctlyhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/broken_module.potis not formatted correctlyhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.pois not formatted correctlyhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/xml_semi_empty.pois not formatted correctlyhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/eleven_module/i18n/ugly.pois not formatted correctlyhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/test_module/i18n/fr.pois not formatted correctlypo-python-parse-formathttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L53Translation string couldn't be parsed correctly using str.format IndexError('Replacement index 1 out of range for positional args tuple')https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L59Translation string couldn't be parsed correctly using str.format IndexError('Replacement index 1 out of range for positional args tuple')https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L65Translation string couldn't be parsed correctly using str.format KeyError('variable2')https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L71Translation string couldn't be parsed correctly using str.format KeyError('variable2')po-python-parse-printfhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L47Translation string couldn't be parsed correctly using str%variables TypeError('not all arguments converted during string formatting')https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/es.po#L83Translation string couldn't be parsed correctly using str%variables TypeError('%d format: a real number is required, not str')po-requires-modulehttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module/i18n/broken_module.pot#L14Translation entry requires comment#. module: MODULEpo-syntax-errorhttps://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/broken_module2/i18n/en.po#L1Syntax error in po file (line 1)https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.0.30/test_repo/syntax_err_module/i18n/es.po#L1Syntax error in po file (line 19)LicensesThis repository is licensed underAGPL-3.0.OCA, or theOdoo Community Association, is a nonprofit
organization whose mission is to support the collaborative development of Odoo features
and promote its widespread use.CHANGESv0.0.30CI improvements (#93)[REF] setup: Enable py311 classifier (#87)v0.0.29IMP] add xml-duplicate-template-id message (#82)[FIX] lints (#86)[ADD] po-duplicate-model-definition check (#85)[REF] Don't filter out messages, move is_message_enabled (#83)[IMP] add xml-record-missing-id (#84)v0.0.28[FIX] oe-structure-missing-id: change constraints, add docs (#81)v0.0.27[REF] improve xpath expressions (#80)v0.0.26[IMP] Improve XPath expressions, compile them only once, fix false negative, add profiling tests (#79)[ADD] pretty-format-po check (#76)[IMP] add xml-oe-structure-missing-id check (#78)[REF] tests: Generate immutable readme (without extra spaces)[IMP] README: Added a section on configurationv0.0.25[REF] requirements.txt: Update polib to fix issues and improves (#72)v0.0.24[FIX] pre-commit: Fix isort hook - RuntimeError The Poetry configuration is invalid (#71)v0.0.23[FIX] Correct documentation (#69)v0.0.22[IMP] Help msg for "xml-view-dangerous-replace-low-priority" (#68)Wrote documentation for proposed refactoring (#66)[FIX] ci: update flake8 repo URL, tox.ini and gh actions .yml (#65)[REF] hooks: Add support for `` (#62)v0.0.21[REF] duplicate-xml-fields: Only applies to direct record's children (#58)v0.0.20[FIX] xml-xpath-translatable-item: Fix false negative calling a method o.amount_to_text() (#57)v0.0.19[FIX] setup: Add missing "requirements.txt" file to package (#441) (#55)v0.0.18[FIX] checks_odoo_module: Support glob expression for "qweb" manifest data section (#54)[IMP] oca_pre_commit_hooks: Add --list-msgs option (#53)[REF] oca_pre_commit_hooks: Silent subprocess git error (#52)v0.0.17[IMP] oca_pre_commit_hooks: Support enable/disable from ENV (#38) (#49)v0.0.16[ADD] xml-xpath-translatable-item: Add new check to identify mutable item used from xpath (#50)v0.0.15[FIX] oca_pre_commit_hooks: Fix exit_status false error (#48)v0.0.14[IMP] oca_pre_commit_hooks: Support for config file (#41)v0.0.13[REF] pylint_odoo: Remove TODO comments (#47)[REF] requirements: Remove unused libraries and pre-commit hooks (#45)[REF] xml-deprecated-data-node: Use the data node sourceline instead of odoo node (#43)[IMP] oca_pre_commit_hooks: Support disable XML checks from disable comments (#42)[REF] README: Fix name of pypi package (#35)[REF] oca_pre_commit_hooks: cli_po, cli: Add cli_po and cli global (#36)[REF] setup: Match requires-python = ">=3.7" from pre-commit[REF] CI: Enable py3.11v0.0.12[REF] checks_odoo_module_xml: Allow duplicated fields with 'groups' (#32)[REF] CI: Enable tox with parallels + codecov compatibility (#33)v0.0.11[REF] codecov: Enable codecov again[REM] missing-readme: Check add to pylint-odoo[REF] TOX: Strip names, remove no-cover, compatible with parallels option (#24)[REF] lint: Adapt lints for py packages instead of odoo module (#23)v0.0.10[REF] README: Update README and fix mutable results auto-generating it (#22)[REF] checks_odoo_module_po: Run on modified PO files only (#21)[REF] manifest: Skip duplicated data files (#20)v0.0.9[FIX] README: Fix regex to replace autogenerated content (#18)[REF] README: Detect from CI if README needs to be updated (#17)v0.0.8[REF] README: Add examples of checks section and script to auto-generate it (#16)[REF] README: Add help section and script to auto-generate it (#15)v0.0.7[REF] checks: name_checks changed to name-checks (#14)[REF] oca_pre_commit_hooks: Use shorter path in messages (#13)[FIX] pre-commit-hooks.yaml: Run checks even if the manifest was not changed[REF] test: Remove TODO comments already fixedv0.0.6[FIX] oca_pre_commit_hooks: Fix checks if it has syntax error (#8)v0.0.5[REF] oca_pre_commit_hooks: Small improvements (#7)v0.0.4[IMP] oca_pre_commit_hooks: Enable feature to 'enable' checks (#6)[IMP] oca_pre_commit_hooks: Add entrypoint arguments to disable checks (#5)v0.0.3[REF] README: Remove deprecated CI buildv0.0.2[REF] CI: Re-use tox to run pre-commit in the CI with same caches and packages[ADD] .pre-commit-hooks.yaml: Compatible with pre-commit-hooks to use as hook id directlyv0.0.1[ADD] Migrate pylint-odoo checks (not related to python) to pre-commit hooks (#2)Initialize