From 074b2c7be6fcdd2f81c0e6232ce33143fa5eff4d Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Thu, 10 Mar 2022 08:51:46 +0000 Subject: [PATCH] [FIX] web: run tooling only on branches starting with master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the tooling for web ran on all branches, this can cause problems because it will automatically lint all files that have been changed on commit, which can cause a lot of noise in the diff which is undesirable in stable branches, as it makes forward ports more difficult, among other things. This commit adds a condition in the tooling so that it only runs on branches whose name starts with master to fix this issue. closes odoo/odoo#86200 X-original-commit: 5962b63f4ad1cfeccc0a80de2307300b50492668 Signed-off-by: Géry Debongnie Signed-off-by: Samuel Degueldre --- addons/web/tooling/_husky/pre-commit | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/tooling/_husky/pre-commit b/addons/web/tooling/_husky/pre-commit index d12bd62b9f0..74847d86c64 100755 --- a/addons/web/tooling/_husky/pre-commit +++ b/addons/web/tooling/_husky/pre-commit @@ -1,4 +1,7 @@ #!/bin/bash . "$(dirname "$0")/_/husky.sh" -npm run format-staged +# run tooling only on branches that start with master to avoid linting noise in stable +if [[ $(git branch --show-current) == master* ]]; then + npm run format-staged +fi