Closed etobella closed 1 year ago
Finally, it is :green_apple: @moylop260 May I ask for your review?
If it is just about excluding files, I think that should be configured on the hook configuration itself, it is a task already performed by pre-commit, and it saves some complexity on hooks themselves.
If we want to fix this upstream (on this repo), we could just change .pre-commit-hooks.yaml
.
Something like this (untested but you get the idea):
diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml
index bb77ed2..7501937 100644
--- a/.pre-commit-hooks.yaml
+++ b/.pre-commit-hooks.yaml
@@ -21,5 +21,5 @@
# The command "identify-cli file.pot"
# returns "text"
types_or: ["text"]
- files: \.(po|pot)$
+ files: i18n/.*\.(po|pot)$
require_serial: false
Also a nitpick of mine but if we are going to update the config file we might as well check if types_or
serves any purpose (seems redundant if we are using files
)
This is the file I am taking about: https://github.com/OCA/odoo-pre-commit-hooks/blob/5e97e13778f2cf7440bc711171f9e4db69a0f6a7/.pre-commit-hooks.yaml#L14-L25
And relevant documentation regarding the files
option:
https://pre-commit.com/#hooks-files
This could be used in order to fix this:
https://github.com/OCA/connector/pull/471#issuecomment-1787342916