Skip to content

Commit

Permalink
basic linting
Browse files Browse the repository at this point in the history
  • Loading branch information
aaltat committed Mar 29, 2024
1 parent 94e4a67 commit 17432c6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,7 @@ lint.select = [
"RET",
"SIM",
"RUF"
]
]

[tool.ruff.lint.per-file-ignores]
"tasks.py" = ["T201"]
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rellu >= 0.7
approvaltests == 11.1.3
robotframework-tidy >= 4.9.0
python-semantic-release >= 9.3.1
mypy >= 1.9.0
# Include normal dependencies from requirements.txt. Makes it possible to use
# requirements-dev.txt as a single requirement file in PyCharm and other IDEs.
-r requirements.txt
14 changes: 14 additions & 0 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from invoke import task


@task
def lint(ctx, fix=False):
print("Run mypy:")
ctx.run("mypy --exclude .venv .")
print("Run black:")
ctx.run("black .")
print("Run ruff:")
ruff_cmd = "ruff check "
if fix:
ruff_cmd = f"{ruff_cmd} --fix"
ctx.run(ruff_cmd)

0 comments on commit 17432c6

Please sign in to comment.