Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: replace black and flake8 by ruff #89

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion daiquiri/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def parse_and_set_default_log_levels(
def set_default_log_levels(
loggers_and_log_levels: typing.Iterable[
typing.Tuple[typing.Optional[str], typing.Union[str, int]]
]
],
) -> None:
"""Set default log levels for some loggers.

Expand Down
2 changes: 1 addition & 1 deletion daiquiri/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def do_rollover(self) -> None:

@staticmethod
def _timedelta_to_seconds(
td: typing.Union[float, int, datetime.timedelta]
td: typing.Union[float, int, datetime.timedelta],
) -> float:
"""Convert a datetime.timedelta object into a seconds interval.

Expand Down
1 change: 0 additions & 1 deletion daiquiri/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flake8: noqa: A005
import logging
import typing

Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we enable more rules than the default ones?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a list of good ones?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. But the default list is quite short. It should replace the former linters at least:

  • flake8
  • flake8-import-order
  • flake8-blind-except
  • flake8-builtins
  • flake8-docstrings
  • flake8-rst-docstrings
  • flake8-logging-format

Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ packages = ["daiquiri"]
test = ["pytest"]
systemd = ["systemd-python>=234"]

[tool.black]
target-version = ['py310', 'py311', 'py312', 'py313']

[tool.mypy]
files = "daiquiri"
show_error_codes = true
Expand Down
20 changes: 3 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,14 @@ commands =
basepython = python3.13
deps =
{[testenv]deps}
black
flake8
ruff
mypy
flake8-import-order
flake8-blind-except
flake8-builtins
flake8-docstrings
flake8-rst-docstrings
flake8-logging-format

commands =
black --check .
flake8
ruff format --check .
ruff check .
mypy

[flake8]
show-source = True
exclude=.git,.tox,dist,build,.eggs
application-import-names=daiquiri
# Black ignore those first fours
ignore = E203,E501,W503,E231,A003,D101,D102,D103,D104,D105,D107,A003,D100

[testenv:docs]
deps = sphinx
commands = sphinx-build -b html doc/source doc/build/html
Loading