Skip to content

Commit

Permalink
clean up lint handling
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Nov 5, 2023
1 parent 74557f9 commit c06f1b7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
- name: Run Linters
run: |
hatch run typing:test
hatch run lint:style
hatch run lint:build
pipx run interrogate -v .
pipx run doc8 --max-line-length=200 --ignore-path=doc/index.rst
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ repos:
- id: codespell
args: ["-L", "incase"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.6.1"
hooks:
- id: mypy
files: "^terminado"
stages: [manual]
args: ["--install-types", "--non-interactive"]
additional_dependencies: ["tornado", "ptyprocess"]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
Expand Down
33 changes: 11 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,24 @@ dependencies = ["coverage", "pytest-cov"]
test = "python -m pytest -vv --cov terminado --cov-branch --cov-report term-missing:skip-covered {args}"
nowarn = "test -W default {args}"

[tool.hatch.envs.typing]
features = ["typing", "test"]
[tool.hatch.envs.typing.scripts]
test = "mypy --install-types --non-interactive {args}"

[tool.hatch.envs.lint]
dependencies = [
"mdformat>0.7",
"mdformat-gfm>=0.3.5",
"ruff==0.1.2"
]
detached = true
dependencies = ["pre-commit"]
[tool.hatch.envs.lint.scripts]
style = [
"ruff format {args:.}",
"ruff {args:.}",
"mdformat --check {args:doc *.md}"
]
fmt = [
"ruff format {args:.}",
"ruff --fix {args:.}",
"mdformat {args:doc *.md}"
]
build = "pre-commit run --all-files ruff"

[tool.hatch.envs.typing]
dependencies = [ "pre-commit"]
detached = true
[tool.hatch.envs.typing.scripts]
test = "pre-commit run --all-files --hook-stage manual mypy"

[tool.pytest.ini_options]
minversion = "6.0"
xfail_strict = true
log_cli_level = "info"
addopts = [
"-raXs", "--durations=10", "--color=yes", "--doctest-modules",
"-ra", "--durations=10", "--color=yes", "--doctest-modules",
"--showlocals", "--strict-markers", "--strict-config"
]
testpaths = [
Expand Down Expand Up @@ -164,4 +153,4 @@ fail-under=100
exclude = ["demos", "doc", "tests"]

[tool.repo-review]
ignore = ["PY007", "PP308", "GH102", "PC140", "PC110"]
ignore = ["PY007", "GH102", "PC110"]

0 comments on commit c06f1b7

Please sign in to comment.