OCA / odoo-pre-commit-hooks

Linters of Odoo addons that complement pylint-odoo
GNU Affero General Public License v3.0
9 stars 11 forks source link

[IMP] oca_pre_commit_hooks: Support for config file #41

Closed antonag32 closed 1 year ago

antonag32 commented 1 year ago

Fixes #37

Argument parser was subclassed in order to hook into the parse_args method without disrupting the existing code flow. All code downstream does not even know of the existence of a config file and just gets the enable, disable options as they did before.

antonag32 commented 1 year ago

Set as Draft since I still need to write unit tests for it.

antonag32 commented 1 year ago

Added unit tests, which are failing. Need to trace the issue since initial debugging shows that enable and disable settings are the same on their equivalent CLI tests (without using a config file) so it is weird that the expected errors are diffeerent.

antonag32 commented 1 year ago

Issue is caused by file writing. Previous contents mash up with new ones whenever the new content is shorter. For example: First write: longwrite Second write: short

write part is not overwritten so end result is shortwrite.