2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-16 20:07:39 +00:00

ruff config

This commit is contained in:
2024-12-15 18:48:28 +00:00
parent 5475a0b853
commit eb74940ca8
4 changed files with 71 additions and 37 deletions

View File

@@ -1,13 +1,12 @@
[tool.black] # Do not edit pyproject.toml, it is overwritten.
line-length = 120 # Instead, edit dev.toml and/or server.toml
[tool.isort]
profile = 'black'
line-length=120
[tool.ruff] [tool.ruff]
# https://docs.astral.sh/ruff/configuration/
# we do not use black or isort, we use ruff instead
line-length=120 line-length=120
ignore = ["E402"] lint.ignore = ["E402", "F541"]
[project] [project]
name = "troggle" name = "troggle"
@@ -26,8 +25,6 @@ dev = [
"unidecode>=1.3.8", "unidecode>=1.3.8",
"black>=24.10.0", "black>=24.10.0",
"coverage>=7.6.9", "coverage>=7.6.9",
"deptry>=0.21.1",
"isort>=5.13.2",
] ]
# conlficting groups not implemented in uv yet # conlficting groups not implemented in uv yet

View File

@@ -1,13 +1,12 @@
[tool.black] # Do not edit pyproject.toml, it is overwritten.
line-length = 120 # Instead, edit dev.toml and/or server.toml
[tool.isort]
profile = 'black'
line-length=120
[tool.ruff] [tool.ruff]
# https://docs.astral.sh/ruff/configuration/
# we do not use black or isort, we use ruff instead
line-length=120 line-length=120
ignore = ["E402"] lint.ignore = ["E402", "F541"]
[project] [project]
name = "troggle" name = "troggle"
@@ -26,8 +25,6 @@ dev = [
"unidecode>=1.3.8", "unidecode>=1.3.8",
"black>=24.10.0", "black>=24.10.0",
"coverage>=7.6.9", "coverage>=7.6.9",
"deptry>=0.21.1",
"isort>=5.13.2",
] ]
# conlficting groups not implemented in uv yet # conlficting groups not implemented in uv yet

View File

@@ -1,3 +1,11 @@
# Do not edit pyproject.toml, it is overwritten.
# Instead, edit dev.toml and/or server.toml
[tool.ruff]
# https://docs.astral.sh/ruff/configuration/
# we do not use black or isort, we use ruff instead
line-length=120
lint.ignore = ["E402", "F541"]
[project] [project]
name = "troggle-server" name = "troggle-server"
@@ -11,4 +19,7 @@ dependencies = [
"piexif==1.1.3", "piexif==1.1.3",
"pillow==9.4.0", "pillow==9.4.0",
"unidecode==1.3.6", "unidecode==1.3.6",
"black>=24.10.0",
"coverage>=7.6.9",
]
] ]

67
urls.py
View File

@@ -1,31 +1,60 @@
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin from django.contrib import admin
from django.urls import include, path, re_path from django.urls import include, path, re_path
from django.conf.urls.static import static
from troggle.core.views import statistics, survex from troggle.core.views import statistics, survex
from troggle.core.views.auth import expologin, expologout from troggle.core.views.auth import expologin, expologout
from troggle.core.views.caves import (cave3d, caveindex, entranceindex, caveslist, from troggle.core.views.caves import (
cavepage, caveslugfwd, caveQMs, edit_cave, cave_debug, cave3d,
edit_entrance, get_entrances, qm, expo_kml, expo_kmz) cave_debug,
caveindex,
cavepage,
caveQMs,
caveslist,
caveslugfwd,
edit_cave,
edit_entrance,
entranceindex,
expo_kml,
expo_kmz,
get_entrances,
qm,
)
from troggle.core.views.drawings import dwgallfiles, dwgfilesingle from troggle.core.views.drawings import dwgallfiles, dwgfilesingle
from troggle.core.views.editor_helpers import image_selector, new_image_form from troggle.core.views.editor_helpers import image_selector, new_image_form
from troggle.core.views.expo import (pubspage, indexpage, editexpopage, expofiles_redirect, from troggle.core.views.expo import (
expofilessingle, expopage, map, mapfile, editexpopage,
mediapage, spider) expofiles_redirect,
from troggle.core.views.logbooks import (QMs_jsonListView, Expeditions_jsonListView, expofilessingle,
Expeditions_tsvListView, expedition, logreport, logentrydelete, expopage,
get_logbook_entries, get_people, indexpage,
logbookentry, notablepersons, person, map,
personexpedition) mapfile,
from troggle.core.views.other import (controlpanel, exportlogbook, frontpage, mediapage,
todos) pubspage,
spider,
)
from troggle.core.views.logbooks import (
Expeditions_jsonListView,
Expeditions_tsvListView,
QMs_jsonListView,
expedition,
get_logbook_entries,
get_people,
logbookentry,
logentrydelete,
logreport,
notablepersons,
person,
personexpedition,
)
from troggle.core.views.other import controlpanel, exportlogbook, frontpage, todos
from troggle.core.views.prospect import prospecting from troggle.core.views.prospect import prospecting
from troggle.core.views.scans import (allscans, cavewallets, scansingle, from troggle.core.views.scans import allscans, cavewallets, scansingle, walletslistperson, walletslistyear
walletslistperson, walletslistyear) from troggle.core.views.uploads import dwgupload, expofilerename, gpxupload, logbookedit, photoupload
from troggle.core.views.uploads import dwgupload, photoupload, gpxupload, expofilerename, logbookedit
from troggle.core.views.wallets_edit import walletedit from troggle.core.views.wallets_edit import walletedit
"""This sets the actualurlpatterns[] and urlpatterns[] lists which django uses """This sets the actualurlpatterns[] and urlpatterns[] lists which django uses
to resolve urls - in both directions as these are declarative. to resolve urls - in both directions as these are declarative.
@@ -56,7 +85,7 @@ todo = '''
# the first place and what they were intended to provide is obscure. # the first place and what they were intended to provide is obscure.
# WHen running on the server, apache intercepts all teh /expofiles/ files so troggle never sees them, # WHen running on the server, apache intercepts all the /expofiles/ files so troggle never sees them,
# so the "content type" is set by whatever apache thinks it should be. Which means .gpx files # so the "content type" is set by whatever apache thinks it should be. Which means .gpx files
# get treated as XML and the web browser fails to do anything usefull # get treated as XML and the web browser fails to do anything usefull