Skip to content

Commit

Permalink
Unignore flake8 check I100
Browse files Browse the repository at this point in the history
This enforces alphabetical order within groups, and requires
'import' statements come before 'from' statements within groups.
  • Loading branch information
czlee committed Feb 26, 2020
1 parent 628f8b0 commit 7a1b457
Show file tree
Hide file tree
Showing 81 changed files with 146 additions and 153 deletions.
3 changes: 1 addition & 2 deletions .flake8
Expand Up @@ -8,11 +8,10 @@
# E226 = missing whitespace around arithmetic operator
# E241 = multiple spaces after ','
# E261 = at least two spaces before inline comment
# I100 = Imported names are in the wrong order.
# Q000 = double quotes
# W504 = line break after binary operator

ignore = C814,E126,E127,E128,E203,E221,E226,E241,E261,I100,Q000,W504
ignore = C814,E126,E127,E128,E203,E221,E226,E241,E261,Q000,W504

max-line-length = 200

Expand Down
2 changes: 1 addition & 1 deletion data/migrate_fixtures.py
Expand Up @@ -3,8 +3,8 @@

import argparse
import os
import re
import platform
import re
import subprocess
import sys
from os.path import abspath, dirname, join, relpath
Expand Down
4 changes: 2 additions & 2 deletions tabbycat/actionlog/management/commands/keytimes.py
@@ -1,10 +1,10 @@
import datetime
import csv
import datetime

from django.utils import timezone

from utils.management.base import TournamentCommand
from actionlog.models import ActionLogEntry
from utils.management.base import TournamentCommand


class Command(TournamentCommand):
Expand Down
2 changes: 1 addition & 1 deletion tabbycat/adjallocation/allocators/hungarian.py
Expand Up @@ -5,8 +5,8 @@
from django.utils.translation import gettext as _, ngettext
from munkres import Munkres

from ..allocation import AdjudicatorAllocation
from .base import AdjudicatorAllocationError, BaseAdjudicatorAllocator, register
from ..allocation import AdjudicatorAllocation

logger = logging.getLogger(__name__)

Expand Down
5 changes: 2 additions & 3 deletions tabbycat/adjallocation/conflicts.py
@@ -1,13 +1,12 @@
"""Utilities for querying and listing conflicts and history between
participants."""
import logging

from itertools import combinations, product

from draw.models import Debate
from participants.models import Adjudicator, Team
from adjallocation.models import (AdjudicatorAdjudicatorConflict, AdjudicatorInstitutionConflict,
AdjudicatorTeamConflict, TeamInstitutionConflict)
from draw.models import Debate
from participants.models import Adjudicator, Team

logger = logging.getLogger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions tabbycat/adjallocation/consumers.py
@@ -1,20 +1,20 @@
import logging
from itertools import groupby
from operator import attrgetter
import logging

from django.db.models import F
from django.utils.translation import gettext as _, ngettext
from django.utils.safestring import mark_safe
from django.utils.translation import gettext as _, ngettext

from actionlog.models import ActionLogEntry
from breakqual.utils import calculate_live_thresholds
from draw.consumers import BaseAdjudicatorContainerConsumer, EditDebateOrPanelWorkerMixin
from participants.prefetch import populate_win_counts
from tournaments.models import Round

from .models import PreformedPanel
from .allocators.base import AdjudicatorAllocationError
from .allocators.hungarian import ConsensusHungarianAllocator, VotingHungarianAllocator
from .models import PreformedPanel
from .preformed import copy_panels_to_debates
from .preformed.anticipated import calculate_anticipated_draw
from .preformed.hungarian import HungarianPreformedPanelAllocator
Expand Down
2 changes: 1 addition & 1 deletion tabbycat/adjallocation/views.py
Expand Up @@ -4,8 +4,8 @@
from django.contrib import messages
from django.db.models import Prefetch
from django.forms import ModelChoiceField
from django.views.generic.base import TemplateView
from django.utils.translation import gettext as _, gettext_lazy, ngettext
from django.views.generic.base import TemplateView

from actionlog.mixins import LogActionMixin
from actionlog.models import ActionLogEntry
Expand Down
4 changes: 2 additions & 2 deletions tabbycat/adjfeedback/dbutils.py
Expand Up @@ -4,15 +4,15 @@
These are mainly used in management commands, but in principle could be used
by a front-end interface as well."""

import random
import itertools
import logging
import random

from django.contrib.auth import get_user_model

from adjallocation.models import DebateAdjudicator
from draw.models import DebateTeam
from participants.models import Adjudicator, Team
from adjallocation.models import DebateAdjudicator

from . import models as fm

Expand Down
3 changes: 1 addition & 2 deletions tabbycat/adjfeedback/forms.py
Expand Up @@ -5,8 +5,7 @@
from django.core.exceptions import ValidationError
from django.db.models import Exists, OuterRef, Prefetch
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy
from django.utils.translation import gettext as _
from django.utils.translation import gettext as _, gettext_lazy

from adjallocation.allocation import AdjudicatorAllocation
from adjallocation.models import DebateAdjudicator
Expand Down
3 changes: 1 addition & 2 deletions tabbycat/adjfeedback/models.py
@@ -1,8 +1,7 @@
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
from django.utils.translation import gettext
from django.utils.translation import gettext, gettext_lazy as _

from adjallocation.models import DebateAdjudicator
from results.models import Submission
Expand Down
10 changes: 5 additions & 5 deletions tabbycat/adjfeedback/views.py
@@ -1,7 +1,7 @@
import csv
import json
import logging
import math
import csv

from django.contrib import messages
from django.db.models import Count, F, Q
Expand All @@ -23,15 +23,15 @@
from tournaments.models import Round
from utils.misc import reverse_tournament
from utils.mixins import AdministratorMixin, AssistantMixin
from utils.views import PostOnlyRedirectView, VueTableTemplateView
from utils.tables import TabbycatTableBuilder
from utils.views import PostOnlyRedirectView, VueTableTemplateView

from .models import AdjudicatorBaseScoreHistory, AdjudicatorFeedback, AdjudicatorFeedbackQuestion
from .forms import make_feedback_form_class, UpdateAdjudicatorScoresForm
from .tables import FeedbackTableBuilder
from .utils import get_feedback_overview
from .models import AdjudicatorBaseScoreHistory, AdjudicatorFeedback, AdjudicatorFeedbackQuestion
from .prefetch import populate_debate_adjudicators
from .progress import get_feedback_progress
from .tables import FeedbackTableBuilder
from .utils import get_feedback_overview

logger = logging.getLogger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions tabbycat/api/views.py
@@ -1,14 +1,14 @@
from dynamic_preferences.api.viewsets import PerInstancePreferenceViewSet
from dynamic_preferences.api.serializers import PreferenceSerializer
from dynamic_preferences.api.viewsets import PerInstancePreferenceViewSet
from rest_framework.generics import GenericAPIView, RetrieveUpdateAPIView
from rest_framework.viewsets import ModelViewSet
from rest_framework.permissions import IsAdminUser
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.viewsets import ModelViewSet

from options.models import TournamentPreferenceModel
from tournaments.models import Tournament
from tournaments.mixins import TournamentFromUrlMixin
from tournaments.models import Tournament

from . import serializers

Expand Down
2 changes: 1 addition & 1 deletion tabbycat/asgi.py
Expand Up @@ -11,8 +11,8 @@

from channels.routing import get_default_application
from sentry_sdk.integrations.asgi import SentryAsgiMiddleware
from sentry_sdk.integrations.logging import LoggingIntegration
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from sentry_sdk.integrations.redis import RedisIntegration

from settings.core import TABBYCAT_VERSION
Expand Down
@@ -1,7 +1,7 @@
from django.db.models import Prefetch

from utils.management.base import TournamentCommand
from availability.models import RoundAvailability
from utils.management.base import TournamentCommand


class Command(TournamentCommand):
Expand Down
2 changes: 1 addition & 1 deletion tabbycat/availability/models.py
@@ -1,6 +1,6 @@
from django.db import models
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import gettext_lazy as _


Expand Down
12 changes: 6 additions & 6 deletions tabbycat/availability/views.py
Expand Up @@ -8,26 +8,26 @@
from django.db.models import Min
from django.db.models.functions import Coalesce
from django.http import JsonResponse
from django.views.generic.base import TemplateView, View
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy, ngettext
from django.views.generic.base import TemplateView, View

from . import utils

from availability.models import RoundAvailability
from actionlog.mixins import LogActionMixin
from actionlog.models import ActionLogEntry
from availability.models import RoundAvailability
from checkins.utils import get_checkins
from draw.generator.utils import partial_break_round_split
from draw.models import Debate
from participants.models import Adjudicator, Team
from tournaments.mixins import RoundMixin
from utils.tables import TabbycatTableBuilder
from utils.misc import reverse_round
from utils.mixins import AdministratorMixin
from utils.tables import TabbycatTableBuilder
from utils.views import PostOnlyRedirectView, VueTableTemplateView
from utils.misc import reverse_round
from venues.models import Venue

from . import utils

logger = logging.getLogger(__name__)


Expand Down
6 changes: 3 additions & 3 deletions tabbycat/breakqual/generator.py
@@ -1,10 +1,10 @@
import logging

from . import base
from breakqual.models import BreakCategory

# These imports add the break generators in those files to the registry.
from . import aida # noqa: F401

from breakqual.models import BreakCategory
from . import base

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tabbycat/breakqual/liveness.py
Expand Up @@ -2,8 +2,8 @@
# Contributed by Thevesh Theva and his work on the debatebreaker.blogspot.com.au
# blog and app.

from math import ceil, factorial, floor
from itertools import accumulate
from math import ceil, factorial, floor


def ncr(n, r):
Expand Down
2 changes: 1 addition & 1 deletion tabbycat/breakqual/models.py
@@ -1,7 +1,7 @@
import math

from django.db import models
from django.core.validators import MinValueValidator
from django.db import models
from django.utils.translation import gettext_lazy as _


Expand Down
6 changes: 3 additions & 3 deletions tabbycat/breakqual/views.py
Expand Up @@ -13,18 +13,18 @@
from actionlog.models import ActionLogEntry
from participants.models import Team
from participants.views import EditSpeakerCategoriesView, UpdateEligibilityEditView as BaseUpdateEligibilityEditView
from tournaments.mixins import PublicTournamentPageMixin, SingleObjectFromTournamentMixin, TournamentMixin
from utils.misc import reverse_tournament
from utils.mixins import AdministratorMixin
from utils.views import PostOnlyRedirectView, VueTableTemplateView
from utils.tables import TabbycatTableBuilder
from tournaments.mixins import PublicTournamentPageMixin, SingleObjectFromTournamentMixin, TournamentMixin
from utils.views import PostOnlyRedirectView, VueTableTemplateView

from . import forms
from .base import BreakGeneratorError
from .generator import BreakGenerator
from .models import BreakCategory, BreakingTeam
from .serializers import BreakCategorySerializer
from .utils import auto_make_break_rounds, breakcategories_with_counts, get_breaking_teams
from . import forms

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tabbycat/checkins/utils.py
Expand Up @@ -3,8 +3,8 @@
import random
import string

from django.db.models import Q
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.utils import timezone
from django.utils.translation import gettext as _

Expand Down
4 changes: 2 additions & 2 deletions tabbycat/checkins/views.py
Expand Up @@ -4,19 +4,19 @@
from channels.layers import get_channel_layer
from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.views.generic.base import TemplateView
from django.template.response import TemplateResponse
from django.utils.translation import gettext as _
from django.views.generic.base import TemplateView

from actionlog.mixins import LogActionMixin
from actionlog.models import ActionLogEntry
from options.utils import use_team_code_names
from participants.models import Person, Speaker
from participants.serializers import InstitutionSerializer
from tournaments.mixins import PublicTournamentPageMixin, TournamentMixin
from utils.misc import reverse_tournament
from utils.mixins import AdministratorMixin, AssistantMixin
from utils.views import PostOnlyRedirectView
from tournaments.mixins import PublicTournamentPageMixin, TournamentMixin
from venues.serializers import VenueSerializer

from .consumers import CheckInEventConsumer
Expand Down
4 changes: 2 additions & 2 deletions tabbycat/draw/generator/bphungarian.py
@@ -1,12 +1,12 @@
import logging
import time
import random
import time
from collections import Counter
from math import log2
from statistics import pvariance

from django.utils.translation import gettext as _
import munkres
from django.utils.translation import gettext as _

from .common import BaseBPDrawGenerator, DrawUserError
from .pairing import BPPairing
Expand Down
2 changes: 1 addition & 1 deletion tabbycat/draw/generator/powerpair.py
Expand Up @@ -4,8 +4,8 @@
from django.utils.translation import gettext as _

from .common import BasePairDrawGenerator, DrawFatalError, DrawUserError
from .pairing import Pairing
from .one_up_one_down import OneUpOneDownSwapper
from .pairing import Pairing


class PowerPairedDrawGenerator(BasePairDrawGenerator):
Expand Down
@@ -1,5 +1,5 @@
from random import shuffle
from operator import attrgetter
from random import shuffle

from utils.management.base import CommandError, RoundCommand

Expand Down
4 changes: 2 additions & 2 deletions tabbycat/draw/manager.py
Expand Up @@ -5,12 +5,12 @@

from draw.generator.powerpair import PowerPairedDrawGenerator
from participants.utils import get_side_history
from tournaments.models import Round
from standings.teams import TeamStandingsGenerator
from tournaments.models import Round

from .models import Debate, DebateTeam
from .generator import BPEliminationResultPairing, DrawGenerator, DrawUserError, ResultPairing
from .generator.utils import ispow2
from .models import Debate, DebateTeam

logger = logging.getLogger(__name__)

Expand Down
5 changes: 2 additions & 3 deletions tabbycat/draw/models.py
@@ -1,9 +1,8 @@
import logging

from django.db import models
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.utils.translation import gettext_lazy as _
from django.utils.translation import gettext
from django.db import models
from django.utils.translation import gettext, gettext_lazy as _

from tournaments.utils import get_side_name

Expand Down

0 comments on commit 7a1b457

Please sign in to comment.