Skip to content

Commit

Permalink
Move to ruff-format
Browse files Browse the repository at this point in the history
  • Loading branch information
bneijt committed Apr 15, 2024
1 parent c36c98a commit c10f5ae
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 88 deletions.
8 changes: 2 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
repos:
- repo: https://github.com/psf/black
rev: "23.7.0"
hooks:
- id: black
language_version: python3.11
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.287"
rev: "v0.3.7"
hooks:
- id: ruff
args: ["--fix", "--exit-non-zero-on-fix"]
- id: ruff-format
73 changes: 1 addition & 72 deletions poetry.lock

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

10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ python = ">=3.8, <4"

[tool.poetry.group.dev.dependencies]
pytest = "^8.1.1"
black = "^24.4.0"
twine = "^5.0.0"
mypy = "^1.5.1"
types-setuptools = "^68.2.0.0"
Expand All @@ -29,10 +28,9 @@ autotrash = 'autotrash.app:main'
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 100
target-version = ['py311']

[tool.ruff]
src = ["src"]
line-length = 100
line-length = 100

[tool.ruff.lint]
extend-select = ["I"]
2 changes: 1 addition & 1 deletion src/autotrash/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from importlib.metadata import version, PackageNotFoundError
from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version(__name__)
Expand Down
4 changes: 1 addition & 3 deletions src/autotrash/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,7 @@ def install_service(options, args):
[Service]
Type=oneshot
ExecStart="{}" {}
""".format(
executable_path, args
)
""".format(executable_path, args)

systemd_dir = os.path.expanduser("~/.config/systemd/user")
os.makedirs(systemd_dir, exist_ok=True)
Expand Down
1 change: 1 addition & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import random
import tempfile
from typing import Dict

from autotrash import app

# ------------- mock functions & helpers --------------
Expand Down

0 comments on commit c10f5ae

Please sign in to comment.