From d428c0e0ddf026089a8e560a757193e3961ea2ec Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 24 Jun 2021 18:49:14 -0700 Subject: [PATCH] lint: Add .bash extension for tools/lib/git-tools.bash. Signed-off-by: Anders Kaseorg --- tools/lib/git-tools.bash | 2 +- tools/lint | 28 ++++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/tools/lib/git-tools.bash b/tools/lib/git-tools.bash index a02469bff5..3197619950 100644 --- a/tools/lib/git-tools.bash +++ b/tools/lib/git-tools.bash @@ -5,7 +5,7 @@ # See git.git commit 92c62a3f4 (from 2010!); as of 2020 with Git 2.26, # this function has only needed one edit since then, adding localization # with gettext, which we can omit. -require_clean_work_tree () { +require_clean_work_tree() { local action="$1" git rev-parse --verify HEAD >/dev/null || exit 1 diff --git a/tools/lint b/tools/lint index b38b58319a..427da71a74 100755 --- a/tools/lint +++ b/tools/lint @@ -45,8 +45,28 @@ def run() -> None: by_lang = linter_config.list_files( groups={ - "backend": ["py", "sh", "pp", "json", "md", "txt", "text", "yaml", "rst", "yml"], - "frontend": ["js", "ts", "flow", "css", "hbs", "html", "lock"], + "backend": [ + "bash", + "json", + "md", + "pp", + "py", + "rst", + "sh", + "text", + "txt", + "yaml", + "yml", + ], + "frontend": [ + "css", + "flow", + "hbs", + "html", + "js", + "lock", + "ts", + ], }, exclude=EXCLUDED_FILES, ) @@ -95,13 +115,13 @@ def run() -> None: linter_config.external_linter( "shellcheck", ["shellcheck", "-x", "-P", "SCRIPTDIR"], - ["sh"], + ["bash", "sh"], description="Standard shell script linter", ) linter_config.external_linter( "shfmt", ["shfmt"], - ["sh"], + ["bash", "sh"], check_arg="-d", fix_arg="-w", description="Formats shell scripts",