Skip to content

Commit 319b78f

Browse files
bencipherfsbraun
andauthored
pre-commit hook updates (#25)
Co-authored-by: Fabian Braun <[email protected]>
1 parent 4efc606 commit 319b78f

File tree

8 files changed

+58
-15
lines changed

8 files changed

+58
-15
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ Use 'x' to check each item: [x] I have ...
2626
* [ ] I have opened this pull request against ``master``
2727
* [ ] I have added or modified the tests when changing logic
2828
* [ ] I have followed [the conventional commits guidelines](https://www.conventionalcommits.org/) to add meaningful information into the changelog
29-
* [ ] I have read the [contribution guidelines ](https://github.com/django-cms/django-cms/blob/develop/CONTRIBUTING.rst) and I have joined #workgroup-pr-review on
29+
* [ ] I have read the [contribution guidelines ](https://github.com/django-cms/django-cms/blob/develop/CONTRIBUTING.rst) and I have joined #workgroup-pr-review on
3030
[Slack](https://www.django-cms.org/slack) to find a “pr review buddy” who is going to review my pull request.

.pre-commit-config.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
ci:
2+
autofix_commit_msg: |
3+
ci: auto fixes from pre-commit hooks
4+
for more information, see https://pre-commit.ci
5+
autofix_prs: false
6+
autoupdate_commit_msg: 'ci: pre-commit autoupdate'
7+
autoupdate_schedule: monthly
8+
9+
repos:
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v4.1.0
12+
hooks:
13+
- id: trailing-whitespace
14+
- id: end-of-file-fixer
15+
- id: check-yaml
16+
- id: check-added-large-files
17+
- id: check-merge-conflict
18+
- id: debug-statements
19+
- id: mixed-line-ending
20+
- id: trailing-whitespace
21+
- repo: https://github.com/asottile/pyupgrade
22+
rev: v3.2.0
23+
hooks:
24+
- id: pyupgrade
25+
args: ["--py39-plus"]
26+
- repo: https://github.com/adamchainz/django-upgrade
27+
rev: '1.4.0'
28+
hooks:
29+
- id: django-upgrade
30+
args: [--target-version, "4.2"]
31+
- repo: https://github.com/PyCQA/flake8
32+
rev: 4.0.1
33+
hooks:
34+
- id: flake8
35+
- repo: https://github.com/asottile/yesqa
36+
rev: v1.3.0
37+
hooks:
38+
- id: yesqa
39+
- repo: https://github.com/pycqa/isort
40+
rev: 5.10.1
41+
hooks:
42+
- id: isort
43+
- repo: https://github.com/codespell-project/codespell
44+
rev: v2.1.0
45+
hooks:
46+
- id: codespell
47+
args: ["--ignore-words-list", "ist, oder, alle"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2121
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2222
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2323
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

djangocms_transfer/cms_plugins.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ def get_plugin_urls(self):
3333
]
3434
return urlpatterns
3535

36-
def get_extra_placeholder_menu_items(self, request, placeholder): # noqa
37-
# django-cms 3.4 compatibility
38-
return self.get_extra_placeholder_menu_items(request, placeholder)
39-
4036
def get_extra_global_plugin_menu_items(self, request, plugin):
4137
# django-cms 3.4 compatibility
4238
return self.get_extra_plugin_menu_items(request, plugin)
@@ -73,7 +69,7 @@ def get_extra_plugin_menu_items(cls, request, plugin):
7369
),
7470
]
7571

76-
@classmethod # noqa
72+
@classmethod
7773
def get_extra_placeholder_menu_items(cls, request, placeholder): # noqa
7874
data = urlencode(
7975
{
@@ -188,8 +184,8 @@ def export_plugins_view(cls, request):
188184

189185
# TODO: Check permissions
190186
filename = form.get_filename()
191-
response = HttpResponse(form.run_export(), content_type="application/json")
192-
response["Content-Disposition"] = "attachment; filename={}".format(filename)
187+
response = HttpResponse(form.run_export(), content_type='application/json')
188+
response['Content-Disposition'] = f'attachment; filename={filename}'
193189
return response
194190

195191

djangocms_transfer/locale/de/LC_MESSAGES/django.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5-
#
5+
#
66
# Translators:
77
# Angelo Dini <[email protected]>, 2019
8-
#
8+
#
99
#, fuzzy
1010
msgid ""
1111
msgstr ""

djangocms_transfer/locale/es/LC_MESSAGES/django.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5-
#
5+
#
66
#, fuzzy
77
msgid ""
88
msgstr ""

djangocms_transfer/locale/fr/LC_MESSAGES/django.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
33
# This file is distributed under the same license as the PACKAGE package.
44
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5-
#
5+
#
66
#, fuzzy
77
msgid ""
88
msgstr ""

tests/test_migrations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ def test_for_missing_migrations(self):
2525
# the "no changes" exit code is 0
2626
status_code = "0"
2727

28-
if status_code == "1":
29-
self.fail("There are missing migrations:\n {}".format(output.getvalue()))
28+
if status_code == '1':
29+
self.fail(f'There are missing migrations:\n {output.getvalue()}')

0 commit comments

Comments
 (0)