Skip to content

Commit

Permalink
Add linting to CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
tasn committed Jun 3, 2024
1 parent 1e69092 commit bbe2fa6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: API Lint
on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.9'

- name: Pip cache
id: pip-cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: api-lint-${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-dev.txt') }}

- name: Install deps
if: steps.pip-cache.outputs.cache-hit != 'true'
run: |
cd api
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
- name: Run linting
run: |
sh ./scripts/lint.sh
8 changes: 8 additions & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -ex

mypy .
npx -q [email protected] .
ruff check .
ruff format --check .

0 comments on commit bbe2fa6

Please sign in to comment.