Skip to content

Commit

Permalink
Update Ruff and pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Feb 14, 2024
1 parent a575d2a commit 054a654
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.2.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
args: [--exit-non-zero-on-fix]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
rev: 24.2.0
hooks:
- id: black

Expand Down Expand Up @@ -43,13 +43,13 @@ repos:
# ]

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.5.3
rev: 1.7.0
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.15
rev: v0.16
hooks:
- id: validate-pyproject

Expand Down
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,22 @@ version.source = "vcs"
local_scheme = "no-local-version"

[tool.ruff]
line-length = 88
fix = true

[tool.ruff.lint]
select = [
"C4", # flake8-comprehensions
"E", # pycodestyle errors
"EM", # flake8-errmsg
"F", # pyflakes errors
"I", # isort
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"PGH", # pygrep-hooks
"RUF100", # unused noqa (yesqa)
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
# "LOG", # TODO: enable flake8-logging when it's not in preview anymore
]
extend-ignore = [
"E203", # Whitespace before ':'
Expand All @@ -88,7 +91,7 @@ extend-ignore = [
"E241", # Multiple spaces after ','
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["norwegianblue"]
required-imports = ["from __future__ import annotations"]

Expand Down
1 change: 1 addition & 0 deletions src/norwegianblue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Python interface to endoflife.date API
https://endoflife.date/docs/api/
"""

from __future__ import annotations

import datetime as dt
Expand Down
1 change: 1 addition & 0 deletions src/norwegianblue/_cache.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Cache functions
"""

from __future__ import annotations

import datetime as dt
Expand Down
1 change: 1 addition & 0 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Unit tests for norwegianblue cache
"""

from __future__ import annotations

import tempfile
Expand Down
1 change: 1 addition & 0 deletions tests/test_norwegianblue.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Unit tests for norwegianblue
"""

from __future__ import annotations

import json
Expand Down

0 comments on commit 054a654

Please sign in to comment.