Skip to content

Commit

Permalink
Merge pull request #32 from maticardenas/ruff-only-for-dev
Browse files Browse the repository at this point in the history
Using `ruff` library only for dev plus config
  • Loading branch information
maticardenas authored Apr 3, 2024
2 parents be4109c + 9a91d50 commit 02743d1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
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()

0 comments on commit 02743d1

Please sign in to comment.