diff --git a/Meta/Linters/lint_executable_resources.sh b/Meta/Linters/lint_executable_resources.sh index bdbb6c006b..75aa6582fd 100755 --- a/Meta/Linters/lint_executable_resources.sh +++ b/Meta/Linters/lint_executable_resources.sh @@ -5,13 +5,21 @@ set -eo pipefail script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) cd "${script_path}/../.." || exit 1 +tests_find_args=( + Tests/ + \( -name WPT -o -path '*/wpt-import' \) -prune + -or +) + +ignored_executable_paths='^(Meta/lint-executable-resources\.sh)$' + if [ "$(uname -s)" = "Darwin" ]; then # MacOS's find does not support '-executable' OR '-perm /mode'. BAD_FILES=$(find Base/res/ -type f -perm +111) - BAD_FILES+=$(find Tests/ -name WPT -prune -or -perm +111 \! -type d -print | grep -Ev '\.(sh|py)$' || true) + BAD_FILES+=$(find "${tests_find_args[@]}" -perm +111 \! -type d -print | grep -Ev "(${ignored_executable_paths}|\\.(sh|py)$)" || true) else BAD_FILES=$(find Base/res/ -type f -executable) - BAD_FILES+=$(find Tests/ -name WPT -prune -or -executable \! -type d -print | grep -Ev '\.(sh|py)$' || true) + BAD_FILES+=$(find "${tests_find_args[@]}" -executable \! -type d -print | grep -Ev "(${ignored_executable_paths}|\\.(sh|py)$)" || true) fi if [ -n "${BAD_FILES}" ] diff --git a/Meta/Linters/lint_python.sh b/Meta/Linters/lint_python.sh index c76647f68e..def464f35b 100755 --- a/Meta/Linters/lint_python.sh +++ b/Meta/Linters/lint_python.sh @@ -7,6 +7,16 @@ cd "${script_path}/../.." || exit 1 overwrite=0 +is_ignored_python_file() { + case "$1" in + Tests/LibWeb/Text/input/wpt-import/*) + return 0 + ;; + esac + + return 1 +} + if [ "$#" -gt "0" ]; then if [ "--overwrite-inplace" = "$1" ] ; then overwrite=1 @@ -17,14 +27,16 @@ fi if [ "$#" -eq "0" ]; then files=() while IFS= read -r file; do - files+=("$file") + if ! is_ignored_python_file "$file"; then + files+=("$file") + fi done < <( git ls-files '*.py' ) else files=() for file in "$@"; do - if [[ "${file}" == *".py" ]]; then + if [[ "${file}" == *".py" ]] && ! is_ignored_python_file "$file"; then files+=("${file}") fi done diff --git a/Meta/Linters/lint_shell_scripts.sh b/Meta/Linters/lint_shell_scripts.sh index 8a5108ad48..47de75f084 100755 --- a/Meta/Linters/lint_shell_scripts.sh +++ b/Meta/Linters/lint_shell_scripts.sh @@ -5,10 +5,22 @@ set -eo pipefail script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) cd "${script_path}/../.." || exit 1 +is_ignored_shell_file() { + case "$1" in + Tests/LibWeb/Text/input/wpt-import/*) + return 0 + ;; + esac + + return 1 +} + if [ "$#" -eq "0" ]; then files=() while IFS= read -r file; do - files+=("$file") + if ! is_ignored_shell_file "$file"; then + files+=("$file") + fi done < <( git ls-files -- \ '*.sh' \ @@ -21,7 +33,7 @@ else continue fi - if [[ "${file}" == *".sh" && "${file}" != "Base/root/generate_manpages.sh" ]]; then + if [[ "${file}" == *".sh" && "${file}" != "Base/root/generate_manpages.sh" ]] && ! is_ignored_shell_file "$file"; then files+=("${file}") fi done diff --git a/pyproject.toml b/pyproject.toml index db53140504..f1e251a482 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,4 +21,5 @@ exclude = [ "**/__pycache__", "**/.*", "**/lit.cfg.py", + "Tests/LibWeb/Text/input/wpt-import", ]