Skip to content

Commit

Permalink
Migrate to linting with Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
JockeTF committed Sep 25, 2024
1 parent f7ea42c commit 0881d7e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: uv sync --all-extras --dev

- name: Check styling
run: uv run flake8 --ignore=E123,E231,W291,W293 fimfarchive tests
run: uv run ruff

- name: Check types
run: uv run mypy
Expand Down
4 changes: 2 additions & 2 deletions fimfarchive/fetchers/fimfiction2.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from jsonapi_client.exceptions import DocumentError
from jsonapi_client.resourceobject import ResourceObject

from fimfarchive import __version__ as VERSION
from fimfarchive import __version__ as version
from fimfarchive.flavors import DataFormat, MetaFormat, MetaPurity, StorySource

from fimfarchive.exceptions import (
Expand Down Expand Up @@ -164,7 +164,7 @@ def create_session(self, token: str) -> Session:
headers = {
'Accept-Encoding': 'gzip, deflate',
'Authorization': f'Bearer {token}',
'User-Agent': f'fimfarchive/{VERSION}',
'User-Agent': f'fimfarchive/{version}',
}

return Session(
Expand Down
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ lz4 = ["lz4~=4.3"]
[tool.uv]
compile-bytecode = true
dev-dependencies = [
"flake8~=5.0",
"mypy~=1.11",
"pytest~=8.3",
"requests-mock~=1.12",
"ruff~=0.6",
"types-jmespath~=1.0",
"types-requests~=2.32",
"types-tqdm~=4.66",
Expand All @@ -45,6 +45,13 @@ venv = ".venv"
[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.ruff]
extend-exclude = ["fimfarchive/__init__.py"]

[tool.ruff.lint]
select = ["A", "E", "F", "N", "RUF", "T10", "W"]
ignore = ["N801", "RUF012"]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
2 changes: 1 addition & 1 deletion tests/fetchers/test_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_len(self, fetcher):
"""
assert 3 == len(fetcher)

def test_len_caching(test, fetcher):
def test_len_caching(self, fetcher):
"""
Tests len is only calculated once.
"""
Expand Down

0 comments on commit 0881d7e

Please sign in to comment.