mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 23:42:53 +03:00
Meta: Lint for duplicate endpoint IDs
We currently have 16 endpoints. The IDs are typed by a human at creation time. This check will detect with we ever use an endpoint ID twice. Since the large irrelevant directories are ignored, this should be quick enough.
This commit is contained in:
parent
7a8c72d136
commit
8d680dd1ad
Notes:
sideshowbarker
2024-07-19 03:36:00 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/8d680dd1adf Pull-request: https://github.com/SerenityOS/serenity/pull/3162 Reviewed-by: https://github.com/vkoskiv ✅
@ -40,6 +40,7 @@ script:
|
||||
- export SERENITY_ROOT="$(pwd)"
|
||||
- Meta/lint-shell-scripts.sh
|
||||
- Meta/lint-executable-resources.sh
|
||||
- Meta/lint-ipc-ids.sh
|
||||
- Meta/check-style.sh
|
||||
- cd Toolchain
|
||||
- TRY_USE_LOCAL_TOOLCHAIN=y ./BuildIt.sh
|
||||
|
18
Meta/lint-ipc-ids.sh
Executable file
18
Meta/lint-ipc-ids.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -e pipefail
|
||||
|
||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||
cd "$script_path/.."
|
||||
|
||||
ALL_ENDPOINTS=$(find \( -name Toolchain -o -name Build -o -name .git -o -name Ports \) -prune -o -name '*.ipc' -print0 | xargs -0 grep -P '^endpoint ' | sort -k4 -n)
|
||||
|
||||
BAD_ENDPOINTS=$(echo "${ALL_ENDPOINTS}" | cut -d' ' -f4 | uniq -d)
|
||||
|
||||
if [ -n "${BAD_ENDPOINTS}" ]
|
||||
then
|
||||
echo "This is the full list of all endpoints:"
|
||||
echo "${ALL_ENDPOINTS}"
|
||||
echo "These endpoint IDs are duplicated:"
|
||||
echo "${BAD_ENDPOINTS}"
|
||||
exit 1
|
||||
fi
|
Loading…
Reference in New Issue
Block a user