Skip to content

Commit

Permalink
feat: replace flake8 with ruff
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bluhm <[email protected]>
  • Loading branch information
dbluhm committed Aug 30, 2023
1 parent 981a3f0 commit 9fc598f
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 170 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,4 @@ _build/
**/*.iml

# Open API build
open-api/.build
open-api/.build
8 changes: 5 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ repos:
hooks:
- id: black
stages: [commit]
- repo: https://github.com/pycqa/flake8.git
rev: 4.0.1
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.285
hooks:
- id: flake8
- id: ruff
stages: [commit]
args: [--fix, --exit-non-zero-on-fix]
163 changes: 46 additions & 117 deletions poetry.lock

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

67 changes: 61 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,9 @@ ursa-bbs-signatures= { version = "~1.0.1", optional = true }
python3-indy= { version = "^1.11.1", optional = true }

[tool.poetry.group.dev.dependencies]
flake8="4.0.1"
# flake8-rst-docstrings=0.0.8
flake8-docstrings="~1.7.0"
flake8-rst="0.7.2"
pre-commit="~3.3.3"
ruff="^0.0.285"

pydocstyle="~6.3.0"
sphinx="1.8.4"
sphinx-rtd-theme=">=0.4.3"

Expand All @@ -84,7 +80,7 @@ asynctest= "0.13.0"
pytest= "~7.4.0"
pytest-asyncio= "0.14.0"
pytest-cov= "2.10.1"
pytest-flake8= "1.1.1"
pytest-ruff="^0.1.1"
mock= "~4.0"

[tool.poetry.extras]
Expand All @@ -103,6 +99,65 @@ indy = [
[tool.poetry.scripts]
aca-py = "aries_cloudagent.__main__:script_main"

[tool.ruff]
select = ["E", "F", "C", "D"]

ignore = [
# Google Python Doc Style
"D203", "D204", "D213", "D215", "D400", "D401", "D404", "D406", "D407",
"D408", "D409", "D413",
"D202", # Allow blank line after docstring
"D104", # Don't require docstring in public package
# Things that we should fix, but are too much work right now
"D417", "C901",
]

line-length = 90

[tool.ruff.per-file-ignores]
"**/{tests}/*" = ["F841", "D", "E501"]

[tool.pytest.ini_options]
testpaths = "aries_cloudagent"
addopts = """
--quiet --junitxml=./test-reports/junit.xml
--cov-config .coveragerc --cov=aries_cloudagent --cov-report term --cov-report xml
--ruff
"""
markers = [
"askar: Tests specifically relating to Aries-Askar support",
"indy: Tests specifically relating to Hyperledger Indy SDK support",
"indy_credx: Tests specifically relating to Indy-Credx support",
"indy_vdr: Tests specifically relating to Indy-VDR support",
"ursa_bbs_signatures: Tests specificaly relating to BBS Signatures support",
"postgres: Tests relating to the postgres storage plugin for Indy",
]
junit_family = "xunit1"
asyncio_mode = "auto"

[tool.coverage.run]

omit = [
"*/tests/*",
"demo/*",
"docker/*",
"docs/*",
"scripts/*",
]
data_file = "test-reports/.coverage"

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"@abstract"
]
precision = 2
skip_covered = true
show_missing = true

[tool.coverage.xml]
output = "test-reports/coverage.xml"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Loading

0 comments on commit 9fc598f

Please sign in to comment.