diff --git a/.github/workflows/empty-files.yml b/.github/workflows/empty-files.yml new file mode 100644 index 0000000000..7e4140efa9 --- /dev/null +++ b/.github/workflows/empty-files.yml @@ -0,0 +1,63 @@ +name: Empty Files Checker + +on: + push: + branches: [ master, staging, stable ] + merge_group: + pull_request: + types: [ opened, reopened, synchronize, ready_for_review ] + paths: + - 'Content.Client/**' + - 'Content.Server/**' + - 'Content.Shared/**' + - 'Resources/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name != 'merge_group' }} + +env: + # Directories to scan for empty files. obj/ and bin/ are skipped + SEARCH_PATHS: "Content.Client Content.Server Content.Shared Resources" + # File extensions to check, without dots + FILE_EXTENSIONS: "cs xaml yaml yml ftl xml json" + +jobs: + check_empty_files: + name: Check for empty files + if: github.actor != 'PJBot' && github.event.pull_request.draft == false + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - name: Setup Submodule + run: git submodule update --init + + - name: Find empty files + shell: bash + run: | + set -e + + read -ra paths <<< "$SEARCH_PATHS" + read -ra exts <<< "$FILE_EXTENSIONS" + + find_expr=() + for ext in "${exts[@]}"; do + find_expr+=( -o -name "*.$ext" ) + done + find_expr=("${find_expr[@]:1}") # drop leading -o + + mapfile -t EMPTY < <( + find "${paths[@]}" \ + \( -name obj -o -name bin \) -prune -o \ + -type f \( "${find_expr[@]}" \) \ + -exec sh -c 'test -z "$(tr -d "[:space:]" < "$1")" && echo "$1"' sh {} \; + ) + + if [ "${#EMPTY[@]}" -gt 0 ]; then + echo "::error::Found empty files:" + printf ' - %s\n' "${EMPTY[@]}" + exit 1 + fi + + echo "No empty files found." diff --git a/Content.Shared/Nutrition/EntitySystems/UtensilSystem.cs b/Content.Shared/Nutrition/EntitySystems/UtensilSystem.cs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Resources/Prototypes/Procedural/salvage_misc.yml b/Resources/Prototypes/Procedural/salvage_misc.yml deleted file mode 100644 index e69de29bb2..0000000000