style -- Linters for petitscours, fix isort

This commit is contained in:
Aurélien Delobelle 2019-01-05 18:14:29 +01:00
parent e6e4a13440
commit debbf265c4
9 changed files with 21 additions and 18 deletions

View file

@ -52,9 +52,9 @@ linters:
- pip install --upgrade black isort flake8
script:
- black --check .
- isort --recursive --check-only --diff bda cof gestioncof kfet provisioning shared utils
- isort --recursive --check-only --diff bda cof gestioncof kfet petitscours provisioning shared utils
# Print errors only
- flake8 --exit-zero bda cof gestioncof kfet provisioning shared utils
- flake8 --exit-zero bda cof gestioncof kfet petitscours provisioning shared utils
cache:
key: linters
paths:

View file

@ -7,13 +7,6 @@ from django.core.urlresolvers import reverse
from django.db.models import Q
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from petitscours.models import (
PetitCoursAbility,
PetitCoursAttribution,
PetitCoursAttributionCounter,
PetitCoursDemande,
PetitCoursSubject,
)
from gestioncof.models import (
Club,
@ -27,6 +20,13 @@ from gestioncof.models import (
SurveyQuestion,
SurveyQuestionAnswer,
)
from petitscours.models import (
PetitCoursAbility,
PetitCoursAttribution,
PetitCoursAttributionCounter,
PetitCoursDemande,
PetitCoursSubject,
)
def add_link_field(target_model="", field="", link_text=str, desc_text=str):

View file

@ -12,6 +12,8 @@ import random
from django.contrib.auth.models import User
from django.core.management import call_command
from gestioncof.management.base import MyBaseCommand
from petitscours.models import (
LEVELS_CHOICES,
PetitCoursAbility,
@ -19,8 +21,6 @@ from petitscours.models import (
PetitCoursSubject,
)
from gestioncof.management.base import MyBaseCommand
# Où sont stockés les fichiers json
DATA_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data")

View file

@ -3,9 +3,9 @@ from django.db import models
from django.db.models.signals import post_delete, post_save
from django.dispatch import receiver
from django.utils.translation import ugettext_lazy as _
from petitscours.models import choices_length
from bda.models import Spectacle
from petitscours.models import choices_length
TYPE_COMMENT_FIELD = (("text", _("Texte long")), ("char", _("Texte court")))

View file

@ -3,6 +3,7 @@ from django import forms
from django.contrib.auth.models import User
from django.forms import ModelForm
from django.forms.models import BaseInlineFormSet, inlineformset_factory
from petitscours.models import PetitCoursAbility, PetitCoursDemande

View file

@ -2,6 +2,7 @@ import os
from django.conf import settings
from django.core.management import call_command
from petitscours.models import (
PetitCoursAbility,
PetitCoursAttributionCounter,

View file

@ -1,8 +1,8 @@
from django.conf.urls import url
from petitscours import views
from petitscours.views import DemandeDetailView, DemandeListView
from gestioncof.decorators import buro_required
from petitscours import views
from petitscours.views import DemandeDetailView, DemandeListView
urlpatterns = [
url(r"^inscription$", views.inscription, name="petits-cours-inscription"),

View file

@ -11,6 +11,9 @@ from django.shortcuts import get_object_or_404, redirect, render
from django.utils import timezone
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import DetailView, ListView
from gestioncof.decorators import buro_required
from gestioncof.models import CofProfile
from petitscours.forms import DemandeForm, MatieresFormSet
from petitscours.models import (
PetitCoursAbility,
@ -19,9 +22,6 @@ from petitscours.models import (
PetitCoursDemande,
)
from gestioncof.decorators import buro_required
from gestioncof.models import CofProfile
class DemandeListView(ListView):
queryset = PetitCoursDemande.objects.prefetch_related("matieres").order_by(

View file

@ -4,6 +4,7 @@ source =
cof
gestioncof
kfet
petitscours
shared
utils
omit =
@ -33,7 +34,7 @@ default_section = THIRDPARTY
force_grid_wrap = 0
include_trailing_comma = true
known_django = django
known_first_party = bda,cof,gestioncof,kfet,shared,utils
known_first_party = bda,cof,gestioncof,kfet,petitscours,shared,utils
line_length = 88
multi_line_output = 3
not_skip = __init__.py