Lint with Ruff instead of Flake8

This commit is contained in:
Joakim Soderlund 2024-09-25 16:53:55 +02:00
parent f7ea42caa6
commit 95816c03b4
4 changed files with 12 additions and 5 deletions

View file

@ -34,7 +34,7 @@ jobs:
run: uv sync --all-extras --dev run: uv sync --all-extras --dev
- name: Check styling - name: Check styling
run: uv run flake8 --ignore=E123,E231,W291,W293 fimfarchive tests run: uv run ruff check
- name: Check types - name: Check types
run: uv run mypy run: uv run mypy

View file

@ -34,7 +34,7 @@ from jsonapi_client.document import Document
from jsonapi_client.exceptions import DocumentError from jsonapi_client.exceptions import DocumentError
from jsonapi_client.resourceobject import ResourceObject 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.flavors import DataFormat, MetaFormat, MetaPurity, StorySource
from fimfarchive.exceptions import ( from fimfarchive.exceptions import (
@ -164,7 +164,7 @@ class ApiClient:
headers = { headers = {
'Accept-Encoding': 'gzip, deflate', 'Accept-Encoding': 'gzip, deflate',
'Authorization': f'Bearer {token}', 'Authorization': f'Bearer {token}',
'User-Agent': f'fimfarchive/{VERSION}', 'User-Agent': f'fimfarchive/{version}',
} }
return Session( return Session(

View file

@ -22,10 +22,10 @@ lz4 = ["lz4~=4.3"]
[tool.uv] [tool.uv]
compile-bytecode = true compile-bytecode = true
dev-dependencies = [ dev-dependencies = [
"flake8~=5.0",
"mypy~=1.11", "mypy~=1.11",
"pytest~=8.3", "pytest~=8.3",
"requests-mock~=1.12", "requests-mock~=1.12",
"ruff~=0.6",
"types-jmespath~=1.0", "types-jmespath~=1.0",
"types-requests~=2.32", "types-requests~=2.32",
"types-tqdm~=4.66", "types-tqdm~=4.66",
@ -45,6 +45,13 @@ venv = ".venv"
[tool.pytest.ini_options] [tool.pytest.ini_options]
testpaths = ["tests"] 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] [build-system]
requires = ["hatchling"] requires = ["hatchling"]
build-backend = "hatchling.build" build-backend = "hatchling.build"

View file

@ -156,7 +156,7 @@ class TestDirectoryFetcher:
""" """
assert 3 == len(fetcher) assert 3 == len(fetcher)
def test_len_caching(test, fetcher): def test_len_caching(self, fetcher):
""" """
Tests len is only calculated once. Tests len is only calculated once.
""" """