Skip to content

Commit

Permalink
Sandbox/CI: Add poethepoet task runner, use it for poe {lint,format}
Browse files Browse the repository at this point in the history
Also, add `ruff` linter, and remove `flake8`.
  • Loading branch information
amotl committed Dec 19, 2022
1 parent 122e064 commit d76d052
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 20 deletions.
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ $(eval bumpversion := $(venvpath)/bin/bumpversion)
$(eval twine := $(venvpath)/bin/twine)
$(eval sphinx := $(venvpath)/bin/sphinx-build)
$(eval coverage := $(venvpath)/bin/coverage)
$(eval flake8 := $(venvpath)/bin/pflake8)
$(eval black := $(venvpath)/bin/black)
$(eval isort := $(venvpath)/bin/isort)
$(eval proselint := $(venvpath)/bin/proselint)
$(eval poe := $(venvpath)/bin/poe)


# Setup Python virtualenv
Expand Down Expand Up @@ -101,12 +101,10 @@ install-tests: setup-virtualenv
# ----------------------

format: setup-virtualenv
$(black) .
$(isort) .
$(poe) format

lint: setup-virtualenv
$(flake8) luftdatenpumpe tests
$(proselint) *.rst doc/**/*.rst
$(poe) lint


# -------
Expand Down
50 changes: 37 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# ==================
# Tool configuration
# ==================

[tool.black]
line-length = 120

[tool.coverage.report]
fail_under = 0
show_missing = true

[tool.coverage.run]
omit = [
"tests/*",
]

[tool.isort]
profile = "black"
line_length = 120
multi_line_output = 3

[tool.flake8]
max-line-length = 120
per-file-ignores = """
luftdatenpumpe/commands.py: E501
luftdatenpumpe/source/rdbms.py: E501
"""

[tool.pytest.ini_options]
minversion = "2.0"
addopts = "-rsfEX -p pytester --strict-markers --verbosity=3 --cov --cov-report=term-missing --cov-report=xml"
Expand All @@ -22,11 +28,29 @@ xfail_strict = true
markers = [
]

[tool.coverage.run]
omit = [
"tests/*",
[tool.ruff]
line-length = 120
extend-exclude = [
"var",
]

[tool.coverage.report]
fail_under = 0
show_missing = true

# ===================
# Tasks configuration
# ===================

[tool.poe.tasks]
build = {cmd="python -m build"}
format = [
{cmd="black ."},
{cmd="isort ."},
]
lint = [
{cmd="ruff ."},
{cmd="black --check ."},
{cmd="isort --check ."},
{cmd="proselint *.rst doc/**/*.rst"}
]
test = [
{cmd="pytest"},
]
4 changes: 2 additions & 2 deletions requirements-utils.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Sandbox
black
isort
pyproject-flake8
flake8<5
poethepoet<1
proselint
ruff

# Release
build
Expand Down

0 comments on commit d76d052

Please sign in to comment.