diff --git a/CMakeLists.txt b/CMakeLists.txt index 1aa0c9a0ac0..4f9c59a3c48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,11 +168,11 @@ if (ENABLE_GUI_TARGETS) endif() add_custom_target(lint-shell-scripts - COMMAND "${ladybird_SOURCE_DIR}/Meta/lint-shell-scripts.sh" + COMMAND "${ladybird_SOURCE_DIR}/Meta/Linters/lint_shell_scripts.sh" USES_TERMINAL ) add_custom_target(check-style - COMMAND ${Python3_EXECUTABLE} "${ladybird_SOURCE_DIR}/Meta/check-style.py" + COMMAND ${Python3_EXECUTABLE} "${ladybird_SOURCE_DIR}/Meta/Linters/check_style.py" USES_TERMINAL ) diff --git a/Documentation/CodingStyle.md b/Documentation/CodingStyle.md index 38ef280ccc9..4e84b06b70d 100644 --- a/Documentation/CodingStyle.md +++ b/Documentation/CodingStyle.md @@ -4,7 +4,7 @@ For low-level styling (spaces, parentheses, brace placement, etc), all code shou **Important: Make sure you use the correct version of `clang-format`!** -See [lint-clang-format.py](../Meta/lint-clang-format.py) for the version enforced in CI. +See [lint_clang_format.py](../Meta/Linters/lint_clang_format.py) for the version enforced in CI. See [AdvancedBuildInstructions.md](AdvancedBuildInstructions.md#clang-format-updates) for instructions on how to get an up-to-date version if your OS distribution does not ship the correct version. diff --git a/Meta/check-debug-flags.sh b/Meta/Linters/check_debug_flags.sh similarity index 98% rename from Meta/check-debug-flags.sh rename to Meta/Linters/check_debug_flags.sh index 96668670394..4d454b53a9f 100755 --- a/Meta/check-debug-flags.sh +++ b/Meta/Linters/check_debug_flags.sh @@ -3,7 +3,7 @@ set -eo pipefail script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) -cd "${script_path}/.." +cd "${script_path}/../.." || exit 1 MISSING_FLAGS=n diff --git a/Meta/check-flatpak.py b/Meta/Linters/check_flatpak.py similarity index 100% rename from Meta/check-flatpak.py rename to Meta/Linters/check_flatpak.py diff --git a/Meta/check-html-doctype.py b/Meta/Linters/check_html_doctype.py similarity index 97% rename from Meta/check-html-doctype.py rename to Meta/Linters/check_html_doctype.py index 440046aa6b6..9a1507c04de 100755 --- a/Meta/check-html-doctype.py +++ b/Meta/Linters/check_html_doctype.py @@ -52,5 +52,5 @@ def run(): if __name__ == "__main__": - os.chdir(os.path.dirname(__file__) + "/..") + os.chdir(os.path.dirname(__file__) + "/../..") run() diff --git a/Meta/check-idl-files.py b/Meta/Linters/check_idl_files.py similarity index 98% rename from Meta/check-idl-files.py rename to Meta/Linters/check_idl_files.py index 058e945a2ec..120053acaed 100755 --- a/Meta/check-idl-files.py +++ b/Meta/Linters/check_idl_files.py @@ -99,5 +99,5 @@ def run(): if __name__ == "__main__": - os.chdir(os.path.dirname(__file__) + "/..") + os.chdir(os.path.dirname(__file__) + "/../..") run() diff --git a/Meta/check-newlines-at-eof.py b/Meta/Linters/check_newlines_at_eof.py similarity index 97% rename from Meta/check-newlines-at-eof.py rename to Meta/Linters/check_newlines_at_eof.py index 943e40afadb..ff3815f5275 100755 --- a/Meta/check-newlines-at-eof.py +++ b/Meta/Linters/check_newlines_at_eof.py @@ -68,5 +68,5 @@ def run(): if __name__ == "__main__": - os.chdir(os.path.dirname(__file__) + "/..") + os.chdir(os.path.dirname(__file__) + "/../..") run() diff --git a/Meta/check-png-sizes.sh b/Meta/Linters/check_png_sizes.sh similarity index 98% rename from Meta/check-png-sizes.sh rename to Meta/Linters/check_png_sizes.sh index a0286d2858c..02e6c46c03a 100755 --- a/Meta/check-png-sizes.sh +++ b/Meta/Linters/check_png_sizes.sh @@ -6,7 +6,7 @@ set -eo pipefail : "${MINIMUM_OPTIMIZATION_BYTES:=1024}" script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) -cd "${script_path}/.." +cd "${script_path}/../.." || exit 1 if ! command -v optipng >/dev/null ; then if [[ "$GITHUB_ACTIONS" == "true" ]]; then diff --git a/Meta/check-style.py b/Meta/Linters/check_style.py similarity index 99% rename from Meta/check-style.py rename to Meta/Linters/check_style.py index b221d91b0a6..e8f0048af31 100755 --- a/Meta/check-style.py +++ b/Meta/Linters/check_style.py @@ -203,5 +203,5 @@ def run(): if __name__ == "__main__": - os.chdir(os.path.dirname(__file__) + "/..") + os.chdir(os.path.dirname(__file__) + "/../..") run() diff --git a/Meta/lint-clang-format.py b/Meta/Linters/lint_clang_format.py similarity index 98% rename from Meta/lint-clang-format.py rename to Meta/Linters/lint_clang_format.py index fdefe375c35..3daabe62598 100755 --- a/Meta/lint-clang-format.py +++ b/Meta/Linters/lint_clang_format.py @@ -13,7 +13,7 @@ from pathlib import Path from typing import List from typing import Optional -sys.path.append(str(Path(__file__).resolve().parent.parent)) +sys.path.append(str(Path(__file__).resolve().parent.parent.parent)) from Meta.host_platform import HostSystem from Meta.host_platform import Platform diff --git a/Meta/lint-executable-resources.sh b/Meta/Linters/lint_executable_resources.sh similarity index 95% rename from Meta/lint-executable-resources.sh rename to Meta/Linters/lint_executable_resources.sh index b65884719ef..bdbb6c006b6 100755 --- a/Meta/lint-executable-resources.sh +++ b/Meta/Linters/lint_executable_resources.sh @@ -3,7 +3,7 @@ set -eo pipefail script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) -cd "$script_path/.." +cd "${script_path}/../.." || exit 1 if [ "$(uname -s)" = "Darwin" ]; then # MacOS's find does not support '-executable' OR '-perm /mode'. diff --git a/Meta/lint-prettier.sh b/Meta/Linters/lint_prettier.sh similarity index 96% rename from Meta/lint-prettier.sh rename to Meta/Linters/lint_prettier.sh index 6fb6d060428..57b290d5136 100755 --- a/Meta/lint-prettier.sh +++ b/Meta/Linters/lint_prettier.sh @@ -3,7 +3,7 @@ set -e script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) -cd "${script_path}/.." || exit 1 +cd "${script_path}/../.." || exit 1 if [ "$#" -eq "0" ]; then files=() diff --git a/Meta/lint-python.sh b/Meta/Linters/lint_python.sh similarity index 96% rename from Meta/lint-python.sh rename to Meta/Linters/lint_python.sh index 7eda6d15da7..6be2effe47b 100755 --- a/Meta/lint-python.sh +++ b/Meta/Linters/lint_python.sh @@ -3,7 +3,7 @@ set -e script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) -cd "${script_path}/.." || exit 1 +cd "${script_path}/../.." || exit 1 overwrite=0 diff --git a/Meta/lint-shell-scripts.sh b/Meta/Linters/lint_shell_scripts.sh similarity index 97% rename from Meta/lint-shell-scripts.sh rename to Meta/Linters/lint_shell_scripts.sh index 8587f0d89d0..8a5108ad48c 100755 --- a/Meta/lint-shell-scripts.sh +++ b/Meta/Linters/lint_shell_scripts.sh @@ -3,7 +3,7 @@ set -eo pipefail script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) -cd "$script_path/.." +cd "${script_path}/../.." || exit 1 if [ "$#" -eq "0" ]; then files=() diff --git a/Meta/lint-ci.sh b/Meta/lint-ci.sh index cd60dedec37..57484ac0d4c 100755 --- a/Meta/lint-ci.sh +++ b/Meta/lint-ci.sh @@ -14,17 +14,17 @@ FAILURES=0 set +e for cmd in \ - Meta/check-debug-flags.sh \ - Meta/check-flatpak.py \ - Meta/check-html-doctype.py \ - Meta/check-idl-files.py \ - Meta/check-newlines-at-eof.py \ - Meta/check-png-sizes.sh \ - Meta/check-style.py \ - Meta/lint-executable-resources.sh \ - Meta/lint-prettier.sh \ - Meta/lint-python.sh \ - Meta/lint-shell-scripts.sh; do + Meta/Linters/check_debug_flags.sh \ + Meta/Linters/check_flatpak.py \ + Meta/Linters/check_html_doctype.py \ + Meta/Linters/check_idl_files.py \ + Meta/Linters/check_newlines_at_eof.py \ + Meta/Linters/check_png_sizes.sh \ + Meta/Linters/check_style.py \ + Meta/Linters/lint_executable_resources.sh \ + Meta/Linters/lint_prettier.sh \ + Meta/Linters/lint_python.sh \ + Meta/Linters/lint_shell_scripts.sh; do if "${cmd}" "$@"; then echo -e "[${GREEN}OK${NC}]: ${cmd}" else @@ -44,10 +44,10 @@ else echo -e "[${GREEN}SKIP${NC}]: IPCMagicLinter (in Meta/lint-ci.sh)" fi -if Meta/lint-clang-format.py --overwrite-inplace "$@" && git diff --exit-code -- ':*.cpp' ':*.h' ':*.mm'; then - echo -e "[${GREEN}OK${NC}]: Meta/lint-clang-format.py" +if Meta/Linters/lint_clang_format.py --overwrite-inplace "$@" && git diff --exit-code -- ':*.cpp' ':*.h' ':*.mm'; then + echo -e "[${GREEN}OK${NC}]: Meta/Linters/lint_clang_format.py" else - echo -e "[${BOLD_RED}FAIL${NC}]: Meta/lint-clang-format.py" + echo -e "[${BOLD_RED}FAIL${NC}]: Meta/Linters/lint_clang_format.py" ((FAILURES+=1)) fi