Skip to content

Commit

Permalink
Use ruff for formatting and remove black
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxincs committed Mar 3, 2024
1 parent 650a620 commit 3e2fc09
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 29 deletions.
12 changes: 2 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ repos:
- id: ruff
args:
- --fix
- id: ruff-format
files: ^.*\.py$
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
Expand All @@ -21,12 +23,6 @@ repos:
args:
- --in-place
- --remove-all-unused-imports
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
args:
- --quiet
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
Expand All @@ -43,10 +39,6 @@ repos:
- --format=custom
- --config=pyproject.toml
additional_dependencies: ["bandit[toml]"]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand Down
15 changes: 1 addition & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,10 @@ where = ["src"]
minversion = "6.0"
asyncio_mode = "auto"

[tool.black]
line-length = 99
target-version = ["py38"]

[tool.isort]
atomic = true
profile = "black"
line_length = 99
force_sort_within_sections = true
skip_gitignore = true
combine_as_imports = true
known_first_party = ["aioapcaccess", "tests"]
forced_separate = ["tests"]

[tool.bandit]
exclude_dirs = ["tests"]

[tool.ruff]
line-length = 99
target-version = "py38"
extend-select = ["I"]
5 changes: 1 addition & 4 deletions src/aioapcaccess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
}


async def request_status(
host: str = "localhost",
port: int = 3551,
) -> OrderedDict[str, str]:
async def request_status(host: str = "localhost", port: int = 3551) -> OrderedDict[str, str]:
"""Connect to the APCUPSd NIS and request its status and return the parsed dict.
:param host: the host which apcupsd is listening on.
Expand Down
1 change: 0 additions & 1 deletion tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from unittest.mock import MagicMock, patch

import pytest

from aioapcaccess import parse_raw_status, request_raw_status, request_status, split_unit

from . import PARSED_DICT, SAMPLE_STATUS
Expand Down

0 comments on commit 3e2fc09

Please sign in to comment.