mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
[CHANGE] Better regex for exclusion in pre-commit
This commit is contained in:
parent
a9a7e03b80
commit
b34661b35d
@ -13,9 +13,23 @@ repos:
|
|||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
- id: fix-byte-order-marker
|
- id: fix-byte-order-marker
|
||||||
- id: trailing-whitespace
|
- 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
|
- 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
|
- id: mixed-line-ending
|
||||||
args: [ '--fix=lf' ]
|
args: [ '--fix=lf' ]
|
||||||
- id: fix-encoding-pragma
|
- id: fix-encoding-pragma
|
||||||
@ -25,7 +39,14 @@ repos:
|
|||||||
rev: 2.4.0
|
rev: 2.4.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: editorconfig-checker
|
- 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
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v2.34.0
|
rev: v2.34.0
|
||||||
|
@ -8,13 +8,13 @@ from uuid import uuid4
|
|||||||
class AnalyticsIdentifier(models.Model):
|
class AnalyticsIdentifier(models.Model):
|
||||||
|
|
||||||
identifier = models.UUIDField(default=uuid4,
|
identifier = models.UUIDField(default=uuid4,
|
||||||
editable=False)
|
editable=False)
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
if not self.pk and AnalyticsIdentifier.objects.exists():
|
if not self.pk and AnalyticsIdentifier.objects.exists():
|
||||||
# Force a single object
|
# Force a single object
|
||||||
raise ValidationError('There is can be only one \
|
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
|
self.pk = self.id = 1 # If this happens to be deleted and recreated, force it to be 1
|
||||||
return super().save(*args, **kwargs)
|
return super().save(*args, **kwargs)
|
||||||
|
|
||||||
|
@ -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.")
|
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,
|
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,
|
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,
|
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,
|
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.")
|
public = models.BooleanField(default=False, help_text="Make this state available to any character.")
|
||||||
|
|
||||||
objects = StateManager()
|
objects = StateManager()
|
||||||
|
@ -34,7 +34,7 @@ class OpTimer(models.Model):
|
|||||||
fc = models.CharField(max_length=254, default="")
|
fc = models.CharField(max_length=254, default="")
|
||||||
post_time = models.DateTimeField(default=timezone.now)
|
post_time = models.DateTimeField(default=timezone.now)
|
||||||
eve_character = models.ForeignKey(EveCharacter, null=True,
|
eve_character = models.ForeignKey(EveCharacter, null=True,
|
||||||
on_delete=models.SET_NULL)
|
on_delete=models.SET_NULL)
|
||||||
description = models.TextField(blank=True, default="")
|
description = models.TextField(blank=True, default="")
|
||||||
type = models.ForeignKey(OpTimerType, null=True, on_delete=models.SET_NULL)
|
type = models.ForeignKey(OpTimerType, null=True, on_delete=models.SET_NULL)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user