create gitlab-ci.yml

This commit is contained in:
Laetitia Getti 2023-04-05 11:12:58 +02:00
parent 1835640799
commit 026c978be0
4 changed files with 31 additions and 9 deletions

10
.coveragerc Normal file
View file

@ -0,0 +1,10 @@
[run]
omit =
*/migrations/*
*/admin.py
*/tests/*
*/urls.py
*/apps.py
la_chariotte/settings.py
la_chariotte/asgi.py
la_chariotte/wsgi.py

View file

@ -9,7 +9,7 @@ https://docs.djangoproject.com/en/4.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""
import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
@ -77,14 +77,18 @@ WSGI_APPLICATION = "la_chariotte.wsgi.application"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "chariotte-db",
"USER": "laetitia",
"PASSWORD": "toto",
"HOST": "127.0.0.1",
"PORT": "5432",
"NAME": os.getenv("DB_NAME", "chariotte-db"),
}
}
if os.getenv("DB_USER"):
DATABASES["default"]["USER"] = os.getenv("DB_USER")
if os.getenv("DB_PASSWORD"):
DATABASES["default"]["PASSWORD"] = os.getenv("DB_PASSWORD")
if os.getenv("DB_HOST"):
DATABASES["default"]["HOST"] = os.getenv("DB_HOST")
if os.getenv("DB_PORT"):
DATABASES["default"]["PORT"] = os.getenv("DB_PORT")
# Password validation
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators

View file

@ -4,6 +4,7 @@ version = "0.0.1"
description = "Web application for organising grouped orders"
readme = "readMe.md"
license = {file = "LICENSE"}
authors = [{name = "Hashbang", email = "support@hashbang.fr"}]
dependencies = [
"django>=4,<5",
"psycopg2>=2,<3",
@ -22,11 +23,14 @@ dev = [
"pip-tools>=6,<7",
"pytest-isort>=3,<4",
"pytest-django>=4,<5",
"pytest-cov>=4,<5",
"diff-cover>=4,<5",
"pytest-black<1",
]
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "la_chariotte.settings"
addopts = "--isort"
addopts = "--isort --black --reuse-db --cov-report xml --cov-report term-missing --cov=la_chariotte -p no:warnings"
isort_ignore = ["*migrations/*.py"]
[tool.isort]

View file

@ -15,13 +15,17 @@ Si il y a des erreurs ISORT, on peut lancer isort pour trier les fichiers :
isort .
```
Vérifier le formatage des fichers avec flake8 :
Si il y a des erreurs BLACK, on peut lancer black pour linter le code :
```bash
black .
```
Vérifier le formatage des fichers avec flake8 :
```bash
flake8
```
Si l'erreur `BLK100 Blakck would make changes.` apparait, on peut lancer black pour formater les fichiers :
Si l'erreur `BLK100 Black would make changes.` apparait, on peut lancer black pour formater les fichiers :
```bash
black .