mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
Meta: Check that "#include <LibM/math.h>" is not being used
This commit is contained in:
parent
7072806234
commit
b1e8807bc5
Notes:
sideshowbarker
2024-07-19 03:43:21 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/b1e8807bc52 Pull-request: https://github.com/SerenityOS/serenity/pull/3104
@ -17,11 +17,18 @@ MISSING_PRAGMA_ONCE_ERRORS=()
|
|||||||
GOOD_PRAGMA_ONCE_PATTERN=$'(^|\\S\n\n)#pragma once(\n\n\\S.|$)'
|
GOOD_PRAGMA_ONCE_PATTERN=$'(^|\\S\n\n)#pragma once(\n\n\\S.|$)'
|
||||||
BAD_PRAGMA_ONCE_ERRORS=()
|
BAD_PRAGMA_ONCE_ERRORS=()
|
||||||
|
|
||||||
|
# We check that "#include <LibM/math.h>" is not being used
|
||||||
|
LIBM_MATH_H_INCLUDE_PATTERN='#include <LibM/math.h>'
|
||||||
|
LIBM_MATH_H_INCLUDE_ERRORS=()
|
||||||
|
|
||||||
while IFS= read -r f; do
|
while IFS= read -r f; do
|
||||||
file_content="$(< "$f")"
|
file_content="$(< "$f")"
|
||||||
if [[ ! "$file_content" =~ $LICENSE_HEADER_PATTERN ]]; then
|
if [[ ! "$file_content" =~ $LICENSE_HEADER_PATTERN ]]; then
|
||||||
MISSING_LICENSE_HEADER_ERRORS+=("$f")
|
MISSING_LICENSE_HEADER_ERRORS+=("$f")
|
||||||
fi
|
fi
|
||||||
|
if [[ "$file_content" =~ $LIBM_MATH_H_INCLUDE_PATTERN ]]; then
|
||||||
|
LIBM_MATH_H_INCLUDE_ERRORS+=("$f")
|
||||||
|
fi
|
||||||
if [[ "$f" =~ \.h$ ]]; then
|
if [[ "$f" =~ \.h$ ]]; then
|
||||||
if [[ ! "$file_content" =~ $PRAGMA_ONCE_PATTERN ]]; then
|
if [[ ! "$file_content" =~ $PRAGMA_ONCE_PATTERN ]]; then
|
||||||
MISSING_PRAGMA_ONCE_ERRORS+=("$f")
|
MISSING_PRAGMA_ONCE_ERRORS+=("$f")
|
||||||
@ -54,4 +61,8 @@ if (( ${#BAD_PRAGMA_ONCE_ERRORS[@]} )); then
|
|||||||
echo "\"#pragma once\" should have a blank line before and after in these files: ${BAD_PRAGMA_ONCE_ERRORS[*]}"
|
echo "\"#pragma once\" should have a blank line before and after in these files: ${BAD_PRAGMA_ONCE_ERRORS[*]}"
|
||||||
exit_status=1
|
exit_status=1
|
||||||
fi
|
fi
|
||||||
|
if (( ${#LIBM_MATH_H_INCLUDE_ERRORS[@]} )); then
|
||||||
|
echo "\"#include <LibM/math.h>\" should be replaced with just \"#include <math.h>\" in these files: ${LIBM_MATH_H_INCLUDE_ERRORS[*]}"
|
||||||
|
exit_status=1
|
||||||
|
fi
|
||||||
exit "$exit_status"
|
exit "$exit_status"
|
||||||
|
Loading…
Reference in New Issue
Block a user