From 6d04d621172b996ea7e6d8fe482c1f8a7dc032a5 Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Thu, 3 Mar 2022 06:56:38 +0000 Subject: [PATCH] [IMP] web: prevent committing files that will fail test_eslint Currently, we lint and auto-format non-legacy files in web. The tool that we use for this linting and formatting unfortunately does not propagate any linting errors except for parsing errors. This means that it's possible to commit files of which we know in advance that they will break CI. This commit simply relints the files in a standalone manner after they've been formatted, so that if there is a linting error, the commit will be aborted. It is still possible to commit non-conforming code (eg to save work in progress before switching branches) by committing with the --no-verify git flag closes odoo/odoo#85727 Signed-off-by: Aaron Bohy (aab) --- addons/web/tooling/_package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web/tooling/_package.json b/addons/web/tooling/_package.json index 9acb9f00495..4ab01819c5b 100644 --- a/addons/web/tooling/_package.json +++ b/addons/web/tooling/_package.json @@ -20,7 +20,8 @@ }, "lint-staged": { "*.{js,md}": [ - "prettier-eslint --write" + "prettier-eslint --write", + "eslint" ] } }