diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 05faa270..87a570f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,9 +13,23 @@ repos: - id: check-yaml - id: fix-byte-order-marker - id: trailing-whitespace - exclude: (\.min\.css|\.min\.js|\.mo|\.po|swagger\.json)$ + exclude: | + (?x)( + \.min\.css| + \.min\.js| + \.po| + \.mo| + swagger\.json + ) - id: end-of-file-fixer - exclude: (\.min\.css|\.min\.js|\.mo|\.po|swagger\.json)$ + exclude: | + (?x)( + \.min\.css| + \.min\.js| + \.po| + \.mo| + swagger\.json + ) - id: mixed-line-ending args: [ '--fix=lf' ] - id: fix-encoding-pragma @@ -25,7 +39,14 @@ repos: rev: 2.4.0 hooks: - id: editorconfig-checker - exclude: ^(LICENSE|allianceauth\/static\/allianceauth\/css\/themes\/bootstrap-locals.less|allianceauth\/eveonline\/swagger.json|(.*.po)|(.*.mo)) + exclude: | + (?x)( + LICENSE| + allianceauth\/static\/allianceauth\/css\/themes\/bootstrap-locals.less| + \.po| + \.mo| + swagger\.json + ) - repo: https://github.com/asottile/pyupgrade rev: v2.34.0 diff --git a/allianceauth/analytics/models.py b/allianceauth/analytics/models.py index 29a0fd1d..62726c28 100644 --- a/allianceauth/analytics/models.py +++ b/allianceauth/analytics/models.py @@ -8,13 +8,13 @@ from uuid import uuid4 class AnalyticsIdentifier(models.Model): identifier = models.UUIDField(default=uuid4, - editable=False) + editable=False) def save(self, *args, **kwargs): if not self.pk and AnalyticsIdentifier.objects.exists(): # Force a single object raise ValidationError('There is can be only one \ - AnalyticsIdentifier instance') + AnalyticsIdentifier instance') self.pk = self.id = 1 # If this happens to be deleted and recreated, force it to be 1 return super().save(*args, **kwargs) diff --git a/allianceauth/authentication/models.py b/allianceauth/authentication/models.py index 13f3249a..80fdcd4a 100755 --- a/allianceauth/authentication/models.py +++ b/allianceauth/authentication/models.py @@ -18,13 +18,13 @@ class State(models.Model): priority = models.IntegerField(unique=True, help_text="Users get assigned the state with the highest priority available to them.") member_characters = models.ManyToManyField(EveCharacter, blank=True, - help_text="Characters to which this state is available.") + help_text="Characters to which this state is available.") member_corporations = models.ManyToManyField(EveCorporationInfo, blank=True, - help_text="Corporations to whose members this state is available.") + help_text="Corporations to whose members this state is available.") member_alliances = models.ManyToManyField(EveAllianceInfo, blank=True, - help_text="Alliances to whose members this state is available.") + help_text="Alliances to whose members this state is available.") member_factions = models.ManyToManyField(EveFactionInfo, blank=True, - help_text="Factions to whose members this state is available.") + help_text="Factions to whose members this state is available.") public = models.BooleanField(default=False, help_text="Make this state available to any character.") objects = StateManager() diff --git a/allianceauth/optimer/models.py b/allianceauth/optimer/models.py index 0479dca6..02139a93 100644 --- a/allianceauth/optimer/models.py +++ b/allianceauth/optimer/models.py @@ -34,7 +34,7 @@ class OpTimer(models.Model): fc = models.CharField(max_length=254, default="") post_time = models.DateTimeField(default=timezone.now) eve_character = models.ForeignKey(EveCharacter, null=True, - on_delete=models.SET_NULL) + on_delete=models.SET_NULL) description = models.TextField(blank=True, default="") type = models.ForeignKey(OpTimerType, null=True, on_delete=models.SET_NULL)