mirror of
https://github.com/Terranom674/Piwigo_Bratonien_Tools.git
synced 2026-09-19 11:44:31 +00:00
Restore mandatory multi-version and script checks
This commit is contained in:
46
.github/workflows/lint.yml
vendored
46
.github/workflows/lint.yml
vendored
@@ -5,8 +5,13 @@ on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
syntax:
|
||||
php-syntax:
|
||||
name: PHP ${{ matrix.php }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php: ['8.2', '8.3', '8.4', '8.5']
|
||||
steps:
|
||||
- name: Repository auschecken
|
||||
uses: actions/checkout@v4
|
||||
@@ -14,7 +19,7 @@ jobs:
|
||||
- name: PHP installieren
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.2'
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: none
|
||||
|
||||
- name: PHP Syntax pruefen
|
||||
@@ -25,6 +30,43 @@ jobs:
|
||||
php -l "$file"
|
||||
done < <(find . -type f -name '*.php' -print0)
|
||||
|
||||
- name: Doppelte Bratonien-Funktionen pruefen
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
python3 - <<'PY'
|
||||
import pathlib
|
||||
import re
|
||||
import sys
|
||||
|
||||
found = {}
|
||||
for path in pathlib.Path('.').rglob('*.php'):
|
||||
text = path.read_text(encoding='utf-8', errors='ignore')
|
||||
for name in re.findall(r'\bfunction\s+(bratonien_tools_[A-Za-z0-9_]+)\s*\(', text):
|
||||
found.setdefault(name, []).append(str(path))
|
||||
|
||||
duplicates = {name: paths for name, paths in found.items() if len(paths) > 1}
|
||||
if duplicates:
|
||||
for name, paths in sorted(duplicates.items()):
|
||||
print(f'{name}: {", ".join(paths)}', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
PY
|
||||
|
||||
script-syntax:
|
||||
name: JavaScript, Python, Shell
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Repository auschecken
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: JavaScript Syntax pruefen
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
while IFS= read -r -d '' file; do
|
||||
node --check "$file"
|
||||
done < <(find . -type f -name '*.js' -print0)
|
||||
|
||||
- name: Python Syntax pruefen
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user