Skip to content

Commit

Permalink
chore: add code quality check tools as dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
zyf722 committed Sep 4, 2024
1 parent 2e52a25 commit 69b3a55
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 10 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,36 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install code quality tools
run: pipx install ruff isort mypy


- name: Check for typos
uses: crate-ci/typos@master

- name: Install Poetry
run: pipx install poetry

- name: Set up Python
id: python
uses: actions/setup-python@v5
with:
python-version: 3.8
cache: poetry

- name: Set Poetry environment
run: poetry env use '${{ steps.python.outputs.python-path }}'

- name: Install dependencies
run: poetry install

- name: Lint code and check code formatting using ruff
run: |
ruff check --output-format=github .
ruff format --check .
poetry run ruff check --output-format=github .
poetry run ruff format --check .
- name: Type-check code using mypy
run: mypy --check-untyped-defs .
run: poetry run mypy --check-untyped-defs .

- name: Check import order using isort
run: isort -c --profile black .
run: poetry run isort -c --profile black .

build:
strategy:
Expand Down
103 changes: 101 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ auto-click-auto = "^0.1.5"

[tool.poetry.group.dev.dependencies]
types-click = "^7.1.8"
ruff = "^0.6.3"
isort = "^5.13.2"
mypy = "^1.11.2"

[tool.poetry.group.test.dependencies]
pytest = "^8.3.2"
Expand Down

0 comments on commit 69b3a55

Please sign in to comment.