Skip to content

Commit

Permalink
chore: lint .env file templates (#3507)
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 authored Apr 16, 2024
1 parent be27ac0 commit 066076b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ jobs:
python-version: '3.10'

- name: Python dependencies
run: pip install ruff
run: pip install ruff dotenv-linter

- name: Ruff check
run: ruff check ./api

- name: Dotenv check
run: dotenv-linter ./api/.env.example ./web/.env.example

- name: Lint hints
if: failure()
run: echo "Please run 'dev/reformat' to fix the fixable linting errors."
Expand Down
8 changes: 8 additions & 0 deletions dev/reformat
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ 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

dotenv-linter ./api/.env.example ./web/.env.example

0 comments on commit 066076b

Please sign in to comment.