Skip to content

Commit

Permalink
Use relative imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel-Therrien-Beslogic committed Mar 22, 2024
1 parent 2230b16 commit 3eb86fc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
"[json][jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features",
},
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.tabSize": 4,
Expand All @@ -61,6 +64,7 @@
"source.convertImportFormat"
// Explicitly omiting "source.unusedImports", can be annoying when commenting code for debugging
],
"python.analysis.importFormat": "relative",
"python.analysis.diagnosticMode": "workspace",
"ruff.importStrategy": "fromEnvironment",
// Use the Ruff extension instead
Expand Down Expand Up @@ -110,5 +114,5 @@
"evenBetterToml.formatter.reorderArrays": true,
"evenBetterToml.formatter.trailingNewline": true,
// We like keeping TOML keys in a certain non-alphabetical order that feels more natural
"evenBetterToml.formatter.reorderKeys": false
"evenBetterToml.formatter.reorderKeys": false,
}
2 changes: 1 addition & 1 deletion canopeum_backend/canopeum_backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.urls import path
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView

from canopeum_backend.canopeum_backend import views
from . import views

urlpatterns = [
path("admin/", admin.site.urls),
Expand Down
4 changes: 2 additions & 2 deletions canopeum_backend/canopeum_backend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from rest_framework.response import Response
from rest_framework.views import APIView

from canopeum_backend.canopeum_backend.models import Announcement, Batch, Comment, Like, Post, Site
from canopeum_backend.canopeum_backend.serializers import (
from .models import Announcement, Batch, Comment, Like, Post, Site
from .serializers import (
AnnouncementSerializer,
AuthUserSerializer,
BatchSerializer,
Expand Down
3 changes: 0 additions & 3 deletions canopeum_backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ allow-multiline = false
[tool.ruff.lint.isort]
combine-as-imports = true
split-on-trailing-comma = false
# Unlike isort, Ruff only counts relative imports as local-folder by default for know.
# https://github.com/astral-sh/ruff/issues/3115
# known-local-folder = []

# https://docs.astral.sh/ruff/settings/#mccabe
[tool.ruff.lint.mccabe]
Expand Down

0 comments on commit 3eb86fc

Please sign in to comment.