Skip to content

Commit aa53c5e

Browse files
committed
feat: add pre-commit and dependabot
1 parent 763d9eb commit aa53c5e

39 files changed

+329
-299
lines changed

.github/workflows/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
ignore:
8+
# Ignore all patch releases as we can manually
9+
# upgrade if we run into a bug and need a fix.
10+
- dependency-name: "*"
11+
update-types: ["version-update:semver-patch"]

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Run tests
22

33
on:
44
push:
5-
branches:
5+
branches:
66
- master
77
pull_request:
88
branches:

.pre-commit-config.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
exclude: 'docs/|.etc/'
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.4.0
6+
hooks:
7+
- id: check-yaml
8+
- id: debug-statements
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
12+
- repo: https://github.com/PyCQA/isort
13+
rev: 5.12.0
14+
hooks:
15+
- id: isort
16+
args: ["--profile", "black"]
17+
18+
- repo: https://github.com/psf/black
19+
rev: 23.7.0
20+
hooks:
21+
- id: black
22+
exclude: tests/test_lowlevel.py
23+
24+
- repo: https://github.com/asottile/pyupgrade
25+
rev: v3.10.1
26+
hooks:
27+
- id: pyupgrade
28+
args: [--py37-plus]
29+
30+
- repo: https://github.com/PyCQA/flake8
31+
rev: 6.1.0
32+
hooks:
33+
- id: flake8

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ RUN apk add --no-cache python3 py3-pip tini; \
1818
USER appuser
1919
EXPOSE 8000/tcp
2020
ENTRYPOINT [ "tini", "--" ]
21-
CMD [ "python3", "/app/martor_demo/manage.py", "runserver", "0.0.0.0:8000" ]
21+
CMD [ "python3", "/app/martor_demo/manage.py", "runserver", "0.0.0.0:8000" ]

docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.5'
22
services:
33
web:
44
build: .
5-
ports:
5+
ports:
66
- "8000:8000"
77
container_name: martor_demo
8-
restart: unless-stopped
8+
restart: unless-stopped

martor/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
31
__VERSION__ = "1.6.43"
42
__RELEASE_DATE__ = "30-Mar-2024"
53
__AUTHOR__ = "Agus Makmun (Summon Agus)"

martor/admin.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
# -*- coding: utf-8 -*-
2-
from __future__ import unicode_literals
3-
41
from django.contrib import admin
52

6-
from .widgets import AdminMartorWidget
73
from .models import MartorField
4+
from .widgets import AdminMartorWidget
85

96

107
class MartorModelAdmin(admin.ModelAdmin):
11-
128
formfield_overrides = {
139
MartorField: {"widget": AdminMartorWidget},
1410
}

martor/api.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
from __future__ import unicode_literals
3-
41
import base64
52
import json
63

martor/extensions/emoji.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ def handleMatch(self, m):
667667
if emoji not in EMOJIS:
668668
return emoji
669669

670-
url = "{0}{1}.png".format(EMOJI_URL, emoji.replace(":", ""))
670+
url = "{}{}.png".format(EMOJI_URL, emoji.replace(":", ""))
671671
el = ElementTree.Element("img")
672672
el.set("src", url)
673673
el.set("class", "marked-emoji")

martor/extensions/mention.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def handleMatch(self, m):
3131

3232
"""Makesure `username` is registered and activated."""
3333
if MARTOR_ENABLE_CONFIGS["mention"] == "true" and users.exists():
34-
url = "{0}{1}/".format(
34+
url = "{}{}/".format(
3535
MARTOR_MARKDOWN_BASE_MENTION_URL, username
3636
) # noqa: E501
3737
el = ElementTree.Element("a")

0 commit comments

Comments
 (0)