Commit 13a760fc authored by Vitaly Lipatov's avatar Vitaly Lipatov

tests: add static syntax regression checks

parent 12fb65ee
...@@ -86,3 +86,11 @@ curl -s http://91.232.225.67:82/ | grep title ...@@ -86,3 +86,11 @@ curl -s http://91.232.225.67:82/ | grep title
- НЕ банить другие рабочие серверы (sprintbox и т.д.) без крайней необходимости - НЕ банить другие рабочие серверы (sprintbox и т.д.) без крайней необходимости
- int2.py использует SO_ORIGINAL_DST для определения оригинального IP назначения - int2.py использует SO_ORIGINAL_DST для определения оригинального IP назначения
- IPv6 адрес 2a03:5a00:c:20::67 должен быть назначен на vmbr0 - IPv6 адрес 2a03:5a00:c:20::67 должен быть назначен на vmbr0
# Static checks
Before building a package, run the syntax regression checks for all shipped
Python, PHP and shell files:
```sh
sh tests/static-checks.sh
```
#!/bin/sh
# Syntax-only regression checks for files shipped by the Eterban packages.
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
cd "$root"
find gateway prod-server ban-internal-server -type f -name '*.py' -exec \
python3 -B -c 'import pathlib, sys; p = pathlib.Path(sys.argv[1]); compile(p.read_bytes(), str(p), "exec")' {} \;
find ban-server -type f -name '*.php' -exec php -l {} \;
find gateway prod-server common -type f -name '*.sh' -exec sh -n {} \;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment