chore: use poetry for linter tools installation and bump Ruff from 0.4 to 0.5 (#6081)

This commit is contained in:
Bowen Liang
2024-07-09 23:06:23 +08:00
committed by GitHub
parent 757ceda063
commit f9d00e0498
4 changed files with 33 additions and 33 deletions

View File

@@ -2,19 +2,14 @@
set -x
# python style checks rely on `ruff` in path
if ! command -v ruff &> /dev/null; then
echo "Installing Ruff ..."
pip install ruff
# 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
fi
# run ruff linter
ruff check --fix ./api
# env files linting relies on `dotenv-linter` in path
if ! command -v dotenv-linter &> /dev/null; then
echo "Installing dotenv-linter ..."
pip install dotenv-linter
fi
# run dotenv-linter linter
dotenv-linter ./api/.env.example ./web/.env.example