2024-01-12 12:34:01 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
2024-07-09 23:06:23 +08:00
|
|
|
# style checks rely on commands in path
|
|
|
|
if ! command -v ruff &> /dev/null || ! command -v dotenv-linter &> /dev/null; then
|
|
|
|
echo "Installing linting tools (Ruff, dotenv-linter ...) ..."
|
|
|
|
poetry install -C api --only lint
|
2024-01-12 12:34:01 +08:00
|
|
|
fi
|
2024-02-06 13:21:13 +08:00
|
|
|
|
|
|
|
# run ruff linter
|
2024-11-04 15:23:18 +08:00
|
|
|
poetry run -C api ruff check --fix ./api
|
2024-04-16 19:53:54 +08:00
|
|
|
|
2024-08-15 12:54:05 +08:00
|
|
|
# run ruff formatter
|
2024-11-04 15:23:18 +08:00
|
|
|
poetry run -C api ruff format ./api
|
2024-08-15 12:54:05 +08:00
|
|
|
|
2024-07-09 23:06:23 +08:00
|
|
|
# run dotenv-linter linter
|
2024-11-04 15:23:18 +08:00
|
|
|
poetry run -C api dotenv-linter ./api/.env.example ./web/.env.example
|