Skip to content

Commit

Permalink
Add pyright checking, use pre-commit for code reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-myome committed Sep 18, 2023
1 parent 8bde56c commit 5326287
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ repos:
entry: flake8
language: system
types: [python]
- id: pyright
name: pyright
entry: pyright
language: system
types: [python]
- id: isort
name: isort
entry: isort
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ build: %:
#=> cqa: execute code quality tests
cqa:
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
pyright
isort --profile black --check src
black --check src
bandit -ll -r src
Expand Down Expand Up @@ -93,10 +94,7 @@ tox:
#=> reformat: reformat code with yapf and commit
.PHONY: reformat
reformat:
@if ! git diff --cached --exit-code >/dev/null; then echo "Repository not clean" 1>&2; exit 1; fi
black src tests
isort src tests
git commit -a -m "reformatted with black and isort"
pre-commit

#=> rename: rename files and substitute content for new repo name
.PHONY: rename
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ profile = "black"
src_paths = ["src"]


[tool.pyright]
include = ["src"]


# [tool.flake8]
# flake8 does not support configuration in pyproject.toml
# https://github.com/PyCQA/flake8/issues/234#issuecomment-812800832
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dev =
mypy
pre-commit~=3.4
pylint~=2.14
pyright==1.1.327
pytest-cov~=4.1
pytest-optional-tests
pytest~=7.1
Expand Down
2 changes: 1 addition & 1 deletion src/biocommons/example/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import importlib
import importlib.resources

import pytest
import yaml
Expand Down

0 comments on commit 5326287

Please sign in to comment.