OCA / pylint-odoo

Odoo plugin for Pylint
http://www.pylint.org
143 stars 168 forks source link

[REF] pylint_odoo: visit_dict - Use the dictionary key node #407

Closed moylop260 closed 1 year ago

moylop260 commented 1 year ago

Improve the line number (lineno) with the dictionary key where the check was raised

See the following old output:


testing/resources/test_repo/broken_module/__openerp__.py:2: [C8101(manifest-required-author), ] One of the following authors must be present in manifest: 'Odoo Community Association (OCA)'
testing/resources/test_repo/broken_module/__openerp__.py:2: [C8102(manifest-required-key), ] Missing required key "license" in manifest file
testing/resources/test_repo/broken_module/__openerp__.py:2: [C8103(manifest-deprecated-key), ] Deprecated key "description" in manifest file
testing/resources/test_repo/broken_module/__openerp__.py:2: [C8106(manifest-version-format), ] Wrong Version Format "8_0.1.0.0" in manifest file. Regex to match: "(4\.2|5\.0|6\.0|6\.1|7\.0|8\.0|9\.0|10\.0|11\.0|12\.0|13\.0|14\.0|15\.0|16\.0)\.\d+\.\d+\.\d+$"
testing/resources/test_repo/broken_module/__openerp__.py:2: [W8125(manifest-data-duplicated), ] The file "duplicated.xml" is duplicated 2 times from manifest key "data"
testing/resources/test_repo/broken_module2/__openerp__.py:2: [C8105(license-allowed), ] License "unknow license" not allowed in manifest file.
testing/resources/test_repo/broken_module2/__openerp__.py:2: [C8106(manifest-version-format), ] Wrong Version Format "1.0" in manifest file. Regex to match: "(4\.2|5\.0|6\.0|6\.1|7\.0|8\.0|9\.0|10\.0|11\.0|12\.0|13\.0|14\.0|15\.0|16\.0)\.\d+\.\d+\.\d+$"
testing/resources/test_repo/broken_module3/__openerp__.py:2: [C8106(manifest-version-format), ] Wrong Version Format "8.0.1.0.0foo" in manifest file. Regex to match: "(4\.2|5\.0|6\.0|6\.1|7\.0|8\.0|9\.0|10\.0|11\.0|12\.0|13\.0|14\.0|15\.0|16\.0)\.\d+\.\d+\.\d+$"
testing/resources/test_repo/broken_module3/__openerp__.py:2: [E8101(manifest-author-string), ] The author key in the manifest file must be a string (with comma separated values)
testing/resources/test_repo/broken_module3/__openerp__.py:2: [E8104(manifest-maintainers-list), ] The maintainers key in the manifest file must be a list of strings

See the following new output:

testing/resources/test_repo/broken_module/__openerp__.py:11: [W8125(manifest-data-duplicated), ] The file "duplicated.xml" is duplicated 2 times from manifest key "data"
testing/resources/test_repo/broken_module/__openerp__.py:2: [C8102(manifest-required-key), ] Missing required key "license" in manifest file
testing/resources/test_repo/broken_module/__openerp__.py:5: [C8101(manifest-required-author), ] One of the following authors must be present in manifest: 'Odoo Community Association (OCA)'
testing/resources/test_repo/broken_module/__openerp__.py:7: [C8103(manifest-deprecated-key), ] Deprecated key "description" in manifest file
testing/resources/test_repo/broken_module/__openerp__.py:8: [C8106(manifest-version-format), ] Wrong Version Format "8_0.1.0.0" in manifest file. Regex to match: "(4\.2|5\.0|6\.0|6\.1|7\.0|8\.0|9\.0|10\.0|11\.0|12\.0|13\.0|14\.0|15\.0|16\.0)\.\d+\.\d+\.\d+$"
testing/resources/test_repo/broken_module2/__openerp__.py:4: [C8105(license-allowed), ] License "unknow license" not allowed in manifest file.
testing/resources/test_repo/broken_module2/__openerp__.py:8: [C8106(manifest-version-format), ] Wrong Version Format "1.0" in manifest file. Regex to match: "(4\.2|5\.0|6\.0|6\.1|7\.0|8\.0|9\.0|10\.0|11\.0|12\.0|13\.0|14\.0|15\.0|16\.0)\.\d+\.\d+\.\d+$"
testing/resources/test_repo/broken_module3/__openerp__.py:5: [E8101(manifest-author-string), ] The author key in the manifest file must be a string (with comma separated values)
testing/resources/test_repo/broken_module3/__openerp__.py:6: [E8104(manifest-maintainers-list), ] The maintainers key in the manifest file must be a list of strings
testing/resources/test_repo/broken_module3/__openerp__.py:8: [C8106(manifest-version-format), ] Wrong Version Format "8.0.1.0.0foo" in manifest file. Regex to match: "(4\.2|5\.0|6\.0|6\.1|7\.0|8\.0|9\.0|10\.0|11\.0|12\.0|13\.0|14\.0|15\.0|16\.0)\.\d+\.\d+\.\d+$"

Notice the number of line is exact match for new one