From 4d61e7efe8e01748a7b705d25ead89c8e3dfffa5 Mon Sep 17 00:00:00 2001 From: Helias Date: Sun, 20 Sep 2026 15:55:09 +0200 Subject: [PATCH] ci: use the shared codestyle workflow --- .github/workflows/core_codestyle.yml | 17 +++--------- apps/ci/.gitkeep | 0 apps/ci/ci-codestyle.sh | 40 ---------------------------- 3 files changed, 4 insertions(+), 53 deletions(-) delete mode 100644 apps/ci/.gitkeep delete mode 100644 apps/ci/ci-codestyle.sh diff --git a/.github/workflows/core_codestyle.yml b/.github/workflows/core_codestyle.yml index 3f9a73e..b8e89b5 100644 --- a/.github/workflows/core_codestyle.yml +++ b/.github/workflows/core_codestyle.yml @@ -1,19 +1,10 @@ name: Codestyle Checks on: push: - branches: [ master ] + branches: + - 'master' pull_request: - branches: [ master ] jobs: - check-codestyle: - strategy: - fail-fast: false - - runs-on: ubuntu-latest - name: Check Codestyling - steps: - - uses: actions/checkout@v2 - - - name: Check Codestyling - run: source ./apps/ci/ci-codestyle.sh + codestyle: + uses: azerothcore/reusable-workflows/.github/workflows/codestyle_modules.yml@main diff --git a/apps/ci/.gitkeep b/apps/ci/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/apps/ci/ci-codestyle.sh b/apps/ci/ci-codestyle.sh deleted file mode 100644 index c96a31d..0000000 --- a/apps/ci/ci-codestyle.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -set -e - -echo "Codestyle check script:" -echo - -declare -A singleLineRegexChecks=( - ["LOG_.+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above" - ["[[:blank:]]$"]="Remove whitespace at the end of the lines above" - ["\t"]="Replace tabs with 4 spaces in the lines above" -) - -for check in ${!singleLineRegexChecks[@]}; do - echo " Checking RegEx: '${check}'" - - if grep -P -r -I -n ${check} src; then - echo - echo "${singleLineRegexChecks[$check]}" - exit 1 - fi -done - -declare -A multiLineRegexChecks=( - ["LOG_[^;]+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above" - ["\n\n\n"]="Multiple blank lines detected, keep only one. Check the files above" -) - -for check in ${!multiLineRegexChecks[@]}; do - echo " Checking RegEx: '${check}'" - - if grep -Pzo -r -I ${check} src; then - echo - echo - echo "${multiLineRegexChecks[$check]}" - exit 1 - fi -done - -echo -echo "Everything looks good"