Add ruffs isort rules
Co-Authored-By: Sean Mooney <smooney@redhat.com> Change-Id: Iefecc6584d216f379a7b94a0d295106a161b765b Signed-off-by: Victoria Martinez de la Cruz <victoria@redhat.com>
This commit is contained in:
co-authored by
Sean Mooney
parent
14f09957a9
commit
a9ccbcb875
+43
-1
@@ -34,7 +34,49 @@ Repository = "https://opendev.org/openstack/grian-ui"
|
||||
Issues = "https://bugs.launchpad.net/grian-ui"
|
||||
Changelog = "https://docs.openstack.org/releasenotes/grian-ui/"
|
||||
|
||||
|
||||
[tool.stestr]
|
||||
test_path = "./tests/grian_ui_tests/unit"
|
||||
top_dir = "./"
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 79
|
||||
target-version = "py310"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E4", "E7", "E9", "F", "G", "I", "LOG", "S", "UP", "W", "C90"]
|
||||
external = ["H"]
|
||||
ignore = [
|
||||
# asserts used for type narrowing only
|
||||
"S101",
|
||||
# S104 Possible binding to all interfaces
|
||||
"S104",
|
||||
# S105/S106 Possible hardcoded password
|
||||
"S105",
|
||||
"S106",
|
||||
# S110 try-except-pass — logged elsewhere
|
||||
"S110",
|
||||
# UP031 % format — defer f-string migration to a later pass
|
||||
"UP031",
|
||||
# UP032 f-string — defer migration to a later pass
|
||||
"UP032",
|
||||
]
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tests/grian_ui_tests/*" = ["S"]
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
known-first-party = ["grian_ui"]
|
||||
force-single-line = true
|
||||
lines-after-imports = 2
|
||||
lines-between-types = 1
|
||||
section-order = ["future", "standard-library", "third-party", "first-party"]
|
||||
# this is the default but just being explicit about the behavior
|
||||
# in case that ever changes.
|
||||
force-sort-within-sections = false
|
||||
|
||||
[tool.ruff.lint.mccabe]
|
||||
max-complexity = 20
|
||||
|
||||
[tool.ruff.format]
|
||||
quote-style = "preserve"
|
||||
docstring-code-format = true
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
|
||||
import setuptools
|
||||
|
||||
|
||||
setuptools.setup(setup_requires=["pbr>=2.0.0"], pbr=True)
|
||||
|
||||
@@ -21,6 +21,7 @@ Including another URLconf
|
||||
from django.contrib import admin
|
||||
from django.urls import path
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("admin/", admin.site.urls),
|
||||
]
|
||||
|
||||
@@ -14,6 +14,7 @@ import os
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "grian_ui.settings")
|
||||
|
||||
application = get_wsgi_application()
|
||||
|
||||
Reference in New Issue
Block a user