From b9e87bd0ad0e61c5a4023eb56a454ba66df25f8e Mon Sep 17 00:00:00 2001 From: rmanach Date: Thu, 21 Sep 2023 15:04:05 +0200 Subject: [PATCH] add pyproject.toml --- Makefile | 10 +++------- deployment/models.py | 1 - deployment/views.py | 2 +- pyproject.toml | 18 ++++++++++++++++++ 4 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 pyproject.toml diff --git a/Makefile b/Makefile index 24ea38c..89164c9 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,8 @@ -# TODO(rmanach): add a pyproject.toml - format: - black deployment/*.py - black mumui/*.py + @black mumui/*.py deployment/*.py lint: - ruff deployment/*.py - ruff mumui/*.py + @ruff . dev: rm -rf venv @@ -14,7 +10,7 @@ dev: ./venv/bin/pip install -r requirements.txt ./venv/bin/pip install -r requirements-dev.txt -django: +django: format lint docker build . -t mumui:local pushpin-local: diff --git a/deployment/models.py b/deployment/models.py index b50dfa4..a9a4698 100644 --- a/deployment/models.py +++ b/deployment/models.py @@ -1,5 +1,4 @@ from enum import Enum -from datetime import datetime from django.contrib.auth.models import User diff --git a/deployment/views.py b/deployment/views.py index 6272252..6a53aa7 100644 --- a/deployment/views.py +++ b/deployment/views.py @@ -72,5 +72,5 @@ def create(request): ) except Exception as e: return HttpResponseServerError(e) - + return HttpResponseRedirect("/deployment") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e410359 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,18 @@ +[tool.black] +line-length = 88 + +[tool.ruff] +select = ["E", "F"] +ignore = [] +exclude = [ + ".git", + ".ruff_cache", + "venv", + "settings.py" +] + +line-length = 88 +target-version = "py310" + +[tool.ruff.mccabe] +max-complexity = 10 \ No newline at end of file