mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: chuanshanjida <chuanshanjida@outlook.com> Co-authored-by: Ed Hennis <ed@ripple.com> Co-authored-by: Bart <bthomee@users.noreply.github.com> Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com> Co-authored-by: Zhiyuan Wang <96991820+Kassaking7@users.noreply.github.com> Co-authored-by: Alex Kremer <akremer@ripple.com> Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com> Co-authored-by: Sergey Kuznetsov <skuznetsov@ripple.com> Co-authored-by: JCW <a1q123456@users.noreply.github.com> Co-authored-by: xrplf-ai-reviewer[bot] <266832837+xrplf-ai-reviewer[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gregory Tsipenyuk <gregtatcam@users.noreply.github.com> Co-authored-by: chuanshanjida <chuanshanjida@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Vito Tumas <5780819+Tapanito@users.noreply.github.com>
31 lines
892 B
Bash
Executable File
31 lines
892 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Exit the script as soon as an error occurs.
|
|
set -e
|
|
|
|
# This script checks whether there are no new include guards introduced by a new
|
|
# PR, as header files should use "#pragma once" instead. The script assumes any
|
|
# include guards will use "XRPL_" as prefix.
|
|
# Usage: .github/scripts/rename/include.sh <repository directory>
|
|
|
|
if [ "$#" -ne 1 ]; then
|
|
echo "Usage: $0 <repository directory>"
|
|
exit 1
|
|
fi
|
|
|
|
DIRECTORY=$1
|
|
echo "Processing directory: ${DIRECTORY}"
|
|
if [ ! -d "${DIRECTORY}" ]; then
|
|
echo "Error: Directory '${DIRECTORY}' does not exist."
|
|
exit 1
|
|
fi
|
|
|
|
find "${DIRECTORY}" -type f \( -name "*.h" -o -name "*.hpp" -o -name "*.ipp" \) | while read -r FILE; do
|
|
echo "Processing file: ${FILE}"
|
|
if grep -q "#ifndef XRPL_" "${FILE}"; then
|
|
echo "Please replace all include guards by #pragma once."
|
|
exit 1
|
|
fi
|
|
done
|
|
echo "Checking complete."
|