Skip to content

Commit

Permalink
ci(ruff): rework ruff remove black (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkb79 authored Apr 20, 2024
1 parent ffb79dd commit 014b2bd
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 75 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
repos:
- repo: local
hooks:
- id: black
name: black
entry: black
- id: ruff-format
name: ruff format
entry: ruff format
language: system
types: [python]
require_serial: true
Expand Down Expand Up @@ -33,8 +33,8 @@ repos:
language: system
types: [text]
stages: [commit, push, manual]
- id: ruff
name: ruff
- id: ruff-check
name: ruff check
entry: ruff check
language: system
types: [python]
Expand Down
4 changes: 3 additions & 1 deletion examples/get_activation_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

# or use LoginAuthenticator (without register)
auth = Authenticator.from_login(
username="USERNAME", password="PASSWORD", locale="YOUR_COUNTRY_CODE" # noqa: S106
username="USERNAME",
password="PASSWORD", # noqa: S106
locale="YOUR_COUNTRY_CODE",
)


Expand Down
1 change: 0 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def precommit(session: Session) -> None:
"--show-diff-on-failure",
]
session.install(
"black",
"darglint",
"pre-commit",
"pre-commit-hooks",
Expand Down
59 changes: 1 addition & 58 deletions poetry.lock

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

25 changes: 16 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ rsa = ">=4.9"

[tool.poetry.group.dev.dependencies]
Pygments = ">=2.10.0"
black = ">=21.10b0"
coverage = {extras = ["toml"], version = ">=6.2"}
darglint = ">=1.8.1"
mypy = ">=0.930"
Expand All @@ -48,7 +47,7 @@ pre-commit = ">=2.16.0"
pre-commit-hooks = ">=4.1.0"
pytest = ">=6.2.5"
pytest-mock = ">=3.10.0"
ruff = ">=0.0.254"
ruff = ">=0.3.7"
safety = ">=1.10.3"
sphinx = ">=4.3.2"
sphinx-autobuild = ">=2021.3.14"
Expand Down Expand Up @@ -86,7 +85,7 @@ warn_unreachable = true

[tool.ruff]
# missing rst-docstrings check, these should be adding through ruff
line-length = 80
line-length = 88
src = ["src"]
target-version = "py310"
output-format = "grouped"
Expand Down Expand Up @@ -121,12 +120,20 @@ select=[
"UP",
"W",
]
mccabe.max-complexity = 21 # temporarily raise complexity, target is 10
pydocstyle.convention = "google"
isort.force-single-line = false
isort.known-first-party = ["audible"]
isort.lines-after-imports = 2
per-file-ignores."tests/*" = ["S101"]

[tool.ruff.lint.mccabe]
max-complexity = 21 # temporarily raise complexity, target is 10

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.lint.isort]
force-single-line = false
known-first-party = ["audible"]
lines-after-imports = 2

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101"]

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
2 changes: 1 addition & 1 deletion src/audible/aescipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __init__( # type: ignore[no-untyped-def]
salt_marker: bytes = b"$",
kdf_iterations: int = 1000,
hashmod=sha256,
mac=hmac
mac=hmac,
) -> None:
if not 1 <= len(salt_marker) <= 6:
raise ValueError("The salt_marker must be one to six bytes long.")
Expand Down

0 comments on commit 014b2bd

Please sign in to comment.