mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
Meta: Move linter helpers to a subdirectory
Continuing some organization of the Meta directory. lint-ci.sh and lint-commits.sh are left alone as "top-level" linters.
This commit is contained in:
Notes:
github-actions[bot]
2026-04-23 11:32:40 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/3f73528cad0 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/9045
@@ -168,11 +168,11 @@ if (ENABLE_GUI_TARGETS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_custom_target(lint-shell-scripts
|
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
|
USES_TERMINAL
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(check-style
|
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
|
USES_TERMINAL
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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`!**
|
**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
|
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.
|
up-to-date version if your OS distribution does not ship the correct version.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||||
cd "${script_path}/.."
|
cd "${script_path}/../.." || exit 1
|
||||||
|
|
||||||
MISSING_FLAGS=n
|
MISSING_FLAGS=n
|
||||||
|
|
||||||
@@ -52,5 +52,5 @@ def run():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.chdir(os.path.dirname(__file__) + "/..")
|
os.chdir(os.path.dirname(__file__) + "/../..")
|
||||||
run()
|
run()
|
||||||
@@ -99,5 +99,5 @@ def run():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.chdir(os.path.dirname(__file__) + "/..")
|
os.chdir(os.path.dirname(__file__) + "/../..")
|
||||||
run()
|
run()
|
||||||
@@ -68,5 +68,5 @@ def run():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.chdir(os.path.dirname(__file__) + "/..")
|
os.chdir(os.path.dirname(__file__) + "/../..")
|
||||||
run()
|
run()
|
||||||
@@ -6,7 +6,7 @@ set -eo pipefail
|
|||||||
: "${MINIMUM_OPTIMIZATION_BYTES:=1024}"
|
: "${MINIMUM_OPTIMIZATION_BYTES:=1024}"
|
||||||
|
|
||||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||||
cd "${script_path}/.."
|
cd "${script_path}/../.." || exit 1
|
||||||
|
|
||||||
if ! command -v optipng >/dev/null ; then
|
if ! command -v optipng >/dev/null ; then
|
||||||
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
|
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
|
||||||
@@ -203,5 +203,5 @@ def run():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.chdir(os.path.dirname(__file__) + "/..")
|
os.chdir(os.path.dirname(__file__) + "/../..")
|
||||||
run()
|
run()
|
||||||
@@ -13,7 +13,7 @@ from pathlib import Path
|
|||||||
from typing import List
|
from typing import List
|
||||||
from typing import Optional
|
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 HostSystem
|
||||||
from Meta.host_platform import Platform
|
from Meta.host_platform import Platform
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||||
cd "$script_path/.."
|
cd "${script_path}/../.." || exit 1
|
||||||
|
|
||||||
if [ "$(uname -s)" = "Darwin" ]; then
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
# MacOS's find does not support '-executable' OR '-perm /mode'.
|
# MacOS's find does not support '-executable' OR '-perm /mode'.
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||||
cd "${script_path}/.." || exit 1
|
cd "${script_path}/../.." || exit 1
|
||||||
|
|
||||||
if [ "$#" -eq "0" ]; then
|
if [ "$#" -eq "0" ]; then
|
||||||
files=()
|
files=()
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||||
cd "${script_path}/.." || exit 1
|
cd "${script_path}/../.." || exit 1
|
||||||
|
|
||||||
overwrite=0
|
overwrite=0
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||||
cd "$script_path/.."
|
cd "${script_path}/../.." || exit 1
|
||||||
|
|
||||||
if [ "$#" -eq "0" ]; then
|
if [ "$#" -eq "0" ]; then
|
||||||
files=()
|
files=()
|
||||||
@@ -14,17 +14,17 @@ FAILURES=0
|
|||||||
set +e
|
set +e
|
||||||
|
|
||||||
for cmd in \
|
for cmd in \
|
||||||
Meta/check-debug-flags.sh \
|
Meta/Linters/check_debug_flags.sh \
|
||||||
Meta/check-flatpak.py \
|
Meta/Linters/check_flatpak.py \
|
||||||
Meta/check-html-doctype.py \
|
Meta/Linters/check_html_doctype.py \
|
||||||
Meta/check-idl-files.py \
|
Meta/Linters/check_idl_files.py \
|
||||||
Meta/check-newlines-at-eof.py \
|
Meta/Linters/check_newlines_at_eof.py \
|
||||||
Meta/check-png-sizes.sh \
|
Meta/Linters/check_png_sizes.sh \
|
||||||
Meta/check-style.py \
|
Meta/Linters/check_style.py \
|
||||||
Meta/lint-executable-resources.sh \
|
Meta/Linters/lint_executable_resources.sh \
|
||||||
Meta/lint-prettier.sh \
|
Meta/Linters/lint_prettier.sh \
|
||||||
Meta/lint-python.sh \
|
Meta/Linters/lint_python.sh \
|
||||||
Meta/lint-shell-scripts.sh; do
|
Meta/Linters/lint_shell_scripts.sh; do
|
||||||
if "${cmd}" "$@"; then
|
if "${cmd}" "$@"; then
|
||||||
echo -e "[${GREEN}OK${NC}]: ${cmd}"
|
echo -e "[${GREEN}OK${NC}]: ${cmd}"
|
||||||
else
|
else
|
||||||
@@ -44,10 +44,10 @@ else
|
|||||||
echo -e "[${GREEN}SKIP${NC}]: IPCMagicLinter (in Meta/lint-ci.sh)"
|
echo -e "[${GREEN}SKIP${NC}]: IPCMagicLinter (in Meta/lint-ci.sh)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if Meta/lint-clang-format.py --overwrite-inplace "$@" && git diff --exit-code -- ':*.cpp' ':*.h' ':*.mm'; then
|
if Meta/Linters/lint_clang_format.py --overwrite-inplace "$@" && git diff --exit-code -- ':*.cpp' ':*.h' ':*.mm'; then
|
||||||
echo -e "[${GREEN}OK${NC}]: Meta/lint-clang-format.py"
|
echo -e "[${GREEN}OK${NC}]: Meta/Linters/lint_clang_format.py"
|
||||||
else
|
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))
|
((FAILURES+=1))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user