mirror of
https://github.com/XRPLF/rippled.git
synced 2026-02-08 16:02:27 +00:00
Add checking script
This commit is contained in:
27
.github/scripts/rename/include.sh
vendored
Executable file
27
.github/scripts/rename/include.sh
vendored
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/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/pragma.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}"
|
||||
grep '#ifndef XRPL_' "${FILE}" && echo "Please replace all include guards by #pragma once." && exit 1
|
||||
done
|
||||
echo "Checking complete."
|
||||
2
.github/workflows/reusable-check-rename.yml
vendored
2
.github/workflows/reusable-check-rename.yml
vendored
@@ -31,6 +31,8 @@ jobs:
|
||||
run: .github/scripts/rename/namespace.sh .
|
||||
- name: Check config name
|
||||
run: .github/scripts/rename/config.sh .
|
||||
- name: Check include guards
|
||||
run: .github/scripts/rename/include.sh .
|
||||
- name: Check for differences
|
||||
env:
|
||||
MESSAGE: |
|
||||
|
||||
@@ -17,14 +17,6 @@
|
||||
#define STL_SET_HAS_EMPLACE 0
|
||||
#endif
|
||||
|
||||
#ifndef XRPL_ASSETS_ENABLE_STD_HASH
|
||||
#if BEAST_MAC || BEAST_IOS
|
||||
#define XRPL_ASSETS_ENABLE_STD_HASH 0
|
||||
#else
|
||||
#define XRPL_ASSETS_ENABLE_STD_HASH 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace xrpl {
|
||||
|
||||
class Issue_test : public beast::unit_test::suite
|
||||
|
||||
Reference in New Issue
Block a user