Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ruff library only for dev plus config #32

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion poetry.lock

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

30 changes: 19 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ pyYAML = "*"
drf-spectacular = { version = "*", optional = true }
drf-yasg = { version = "*", optional = true }
django-ninja = {version = "^1.1.0", optional = true}
ruff = "^0.3.5"

[tool.poetry.extras]
drf-yasg = ["drf-yasg"]
Expand All @@ -77,20 +76,13 @@ pylint = "*"
pytest = "*"
pytest-django = "*"

[tool.poetry.group.dev.dependencies]
ruff = "^0.3.5"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

[tool.black]
line-length = 120
preview = true
quiet = true
include = '\.pyi?$'

[tool.isort]
profile = "black"
line_length = 120

[tool.pylint.FORMAT]
max-line-length = 120

Expand All @@ -115,6 +107,22 @@ max-locals = 20
[tool.pylint.BASIC]
good-names = "_,e,i"

[tool.ruff]
lint.select = [
"B", # flake8-bugbear
"C", # flake8-comprehensions
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"W", # pycodestyle warnings
]
lint.ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"C901", # too complex
]

[tool.coverage.run]
source = [
"openapi_tester",
Expand Down
5 changes: 2 additions & 3 deletions test_project/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import os
from pathlib import Path

from django.utils.translation import gettext_lazy as _
Expand Down Expand Up @@ -57,7 +56,7 @@
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
"NAME": BASE_DIR / "db.sqlite3",
}
}

Expand All @@ -80,7 +79,7 @@
USE_I18N = True
USE_TZ = True
STATIC_URL = "/test_project/static/"
STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATIC_ROOT = BASE_DIR / "static"

SWAGGER_SETTINGS = {
"DEFAULT_MODEL_RENDERING": "example",
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ def sort_object(data_object: Any) -> Any:


def get_schema_content(schema: Path) -> bytes:
with open(schema, "rb") as schema_file:
with schema.open("rb") as schema_file:
return schema_file.read()
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.