add pre-commit config
This commit is contained in:
parent
1314bca49b
commit
576ad4c171
|
@ -0,0 +1,36 @@
|
||||||
|
# See https://pre-commit.com for more information
|
||||||
|
# See https://pre-commit.com/hooks.html for more hooks
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.4.0
|
||||||
|
hooks:
|
||||||
|
- id: double-quote-string-fixer
|
||||||
|
- repo: https://github.com/psf/black
|
||||||
|
rev: 23.1.0
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
args: ['--target-version', 'py39', '--skip-string-normalization', '--line-length', '110']
|
||||||
|
- repo: https://github.com/PyCQA/isort
|
||||||
|
rev: 5.12.0
|
||||||
|
hooks:
|
||||||
|
- id: isort
|
||||||
|
args: ['--profile', 'black', '--line-length', '110']
|
||||||
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
|
rev: v3.3.1
|
||||||
|
hooks:
|
||||||
|
- id: pyupgrade
|
||||||
|
args: ['--keep-percent-format', '--py39-plus']
|
||||||
|
- repo: https://github.com/adamchainz/django-upgrade
|
||||||
|
rev: 1.13.0
|
||||||
|
hooks:
|
||||||
|
- id: django-upgrade
|
||||||
|
args: ['--target-version', '3.2']
|
||||||
|
- repo: https://github.com/rtts/djhtml
|
||||||
|
rev: '3.0.5'
|
||||||
|
hooks:
|
||||||
|
- id: djhtml
|
||||||
|
args: ['--tabwidth', '2']
|
||||||
|
- repo: https://git.entrouvert.org/pre-commit-debian.git
|
||||||
|
rev: v0.3
|
||||||
|
hooks:
|
||||||
|
- id: pre-commit-debian
|
|
@ -1,9 +1,8 @@
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from django.contrib.contenttypes.models import ContentType
|
|
||||||
|
|
||||||
from authentic2.a2_rbac.models import Role
|
from authentic2.a2_rbac.models import Role
|
||||||
from authentic2.apps.authenticators.models import BaseAuthenticator
|
from authentic2.apps.authenticators.models import BaseAuthenticator
|
||||||
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
from django.db import connection
|
|
||||||
|
|
||||||
from chrono.agendas.models import Event
|
from chrono.agendas.models import Event
|
||||||
|
from django.db import connection
|
||||||
from django.db.models import Count
|
from django.db.models import Count
|
||||||
|
|
||||||
duplicated_events = (
|
duplicated_events = (
|
||||||
Event.objects.values("primary_event", "start_datetime")
|
Event.objects.values('primary_event', 'start_datetime')
|
||||||
.annotate(count=Count("id"))
|
.annotate(count=Count('id'))
|
||||||
.values("pk")
|
.values('pk')
|
||||||
.order_by()
|
.order_by()
|
||||||
.filter(count__gt=1)
|
.filter(count__gt=1)
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
from django.db import connection
|
|
||||||
|
|
||||||
from chrono.agendas.models import TimePeriod
|
from chrono.agendas.models import TimePeriod
|
||||||
|
from django.db import connection
|
||||||
|
|
||||||
periods = TimePeriod.objects.filter(agenda__isnull=False, weekday_indexes__isnull=False)
|
periods = TimePeriod.objects.filter(agenda__isnull=False, weekday_indexes__isnull=False)
|
||||||
if periods.exists():
|
if periods.exists():
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from django.conf import settings
|
|
||||||
from combo.apps.dataviz.models import ChartNgCell
|
from combo.apps.dataviz.models import ChartNgCell
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
base_url = settings.SITE_BASE_URL
|
base_url = settings.SITE_BASE_URL
|
||||||
qs = ChartNgCell.objects.filter(
|
qs = ChartNgCell.objects.filter(
|
||||||
|
@ -12,6 +12,9 @@ for cell in qs:
|
||||||
continue
|
continue
|
||||||
transpose = bool(chart.axis_count == 2)
|
transpose = bool(chart.axis_count == 2)
|
||||||
if transpose:
|
if transpose:
|
||||||
print('Switch to "table inverted" on cell %s from page %s' % (cell.pk, settings.SITE_BASE_URL + cell.page.get_online_url()))
|
print(
|
||||||
|
'Switch to "table inverted" on cell %s from page %s'
|
||||||
|
% (cell.pk, settings.SITE_BASE_URL + cell.page.get_online_url())
|
||||||
|
)
|
||||||
cell.chart_type = 'table-inverted'
|
cell.chart_type = 'table-inverted'
|
||||||
cell.save()
|
cell.save()
|
||||||
|
|
Loading…
Reference in New Issue