Skip to content

Commit ed58558

Browse files
committed
Add pre-commit
1 parent a5407be commit ed58558

File tree

110 files changed

+663
-854
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+663
-854
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ module.exports = {
1616
"prettier/prettier": "error",
1717
quotes: 0,
1818
},
19-
};
19+
}

.github/workflows/tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Tests
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
1010
tests:
@@ -14,11 +14,11 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
python-version:
17-
- 2.7
18-
- 3.6
19-
- 3.7
20-
- 3.8
21-
- 3.9
17+
- 2.7
18+
- 3.6
19+
- 3.7
20+
- 3.8
21+
- 3.9
2222

2323
steps:
2424
- uses: actions/checkout@v2

.pre-commit-config.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
exclude: ".yarn/|yarn.lock|\\.min\\.(css|js)$"
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.1.0
5+
hooks:
6+
- id: check-added-large-files
7+
- id: check-merge-conflict
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
- repo: https://github.com/asottile/pyupgrade
11+
rev: v2.29.1
12+
hooks:
13+
- id: pyupgrade
14+
args: [--py39-plus]
15+
- repo: https://github.com/adamchainz/django-upgrade
16+
rev: 1.4.0
17+
hooks:
18+
- id: django-upgrade
19+
args: [--target-version, "3.2"]
20+
- repo: https://github.com/pycqa/isort
21+
rev: 5.10.1
22+
hooks:
23+
- id: isort
24+
args: [--profile=black, --lines-after-imports=2, --combine-as]
25+
- repo: https://github.com/psf/black
26+
rev: 21.12b0
27+
hooks:
28+
- id: black
29+
- repo: https://github.com/pycqa/flake8
30+
rev: 4.0.1
31+
hooks:
32+
- id: flake8
33+
args: ["--ignore=E203,E501,W503"]
34+
- repo: https://github.com/pre-commit/mirrors-prettier
35+
rev: v2.5.1
36+
hooks:
37+
- id: prettier
38+
args: [--list-different, --no-semi]
39+
exclude: "\\.html$"

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Change log
66
`Next version`_
77
~~~~~~~~~~~~~~~
88

9+
- Added pre-commit.
10+
- Dropped compatibility guarantees with Python < 3.6, Django < 3.2.
11+
912

1013
`v1.20.0`_ (2021-03-22)
1114
~~~~~~~~~~~~~~~~~~~~~~~

docs/advanced/base.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ manage content with the :class:`~feincms.admin.item_editor.ItemEditor`.
1515
.. attribute:: Base.content
1616

1717
Beware not to name subclass field `content` as this will overshadow `ContentProxy` and you will
18-
not be able to reference `ContentProxy`.
18+
not be able to reference `ContentProxy`.
1919

2020
.. method:: Base.create_content_type(model, regions=None, [**kwargs])
2121

docs/advanced/caching.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,15 @@ Here's an (incomplete) list of variables to use in {% cache %} blocks [#djangoca
3636
Depending on the extensions loaded, this varies with the page,
3737
the page's modification date, its language, etc. This is always
3838
a safe bet to use on page specific fragments.
39-
39+
4040
* LANGUAGE_CODE -- even if two requests are asking for the same page,
4141
the html code rendered might differ in translated elements in the
4242
navigation or elsewhere. If the fragment varies on language, include
4343
LANGUAGE_CODE in the cache specifier.
44-
44+
4545
* request.user.id -- different users might be allowed to see different
4646
views of the site. Add request.user.id to the cache specifier if
4747
this is the case.
4848

49-
.. [#djangocache] Please see the django documentation for detailed
49+
.. [#djangocache] Please see the django documentation for detailed
5050
description of the {% cache %} template tag.
51-

docs/conf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# FeinCMS documentation build configuration file, created by
43
# sphinx-quickstart on Mon Aug 10 17:03:33 2009.
@@ -38,16 +37,16 @@
3837
master_doc = "index"
3938

4039
# General information about the project.
41-
project = u"FeinCMS"
42-
copyright = u"2009-2010, Feinheit GmbH and contributors"
40+
project = "FeinCMS"
41+
copyright = "2009-2010, Feinheit GmbH and contributors"
4342

4443
# The version info for the project you're documenting, acts as replacement for
4544
# |version| and |release|, also used in various other places throughout the
4645
# built documents.
4746
#
4847
# The short X.Y version.
4948
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
50-
import feincms
49+
import feincms # noqa
5150

5251

5352
version = ".".join(map(str, feincms.VERSION))
@@ -181,8 +180,8 @@
181180
(
182181
"index",
183182
"FeinCMS.tex",
184-
u"FeinCMS Documentation",
185-
u"Feinheit GmbH and contributors",
183+
"FeinCMS Documentation",
184+
"Feinheit GmbH and contributors",
186185
"manual",
187186
),
188187
]

docs/extensions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ is as follows:
7474
Only model and admin instances which inherit from
7575
:class:`~feincms.extensions.ExtensionsMixin` and
7676
:class:`~feincms.extensions.ExtensionModelAdmin` can be extended
77-
this way.
77+
this way.

docs/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ instead::
2626

2727
$ git clone git://github.com/feincms/feincms.git
2828

29-
Please be aware that feincms3 is being developed as a separate, new project.
30-
For new CMS projects I’m more likely to use django-content-editor and feincms3.
29+
Please be aware that feincms3 is being developed as a separate, new project.
30+
For new CMS projects I’m more likely to use django-content-editor and feincms3.
3131
You can read more about feincms3 on https://feincms3.readthedocs.io/en/latest/
3232

3333
If you are looking to implement a blog, check out elephantblog_.

docs/integration.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,5 +478,3 @@ to work, ie. at least the following attributes should exist:
478478
level = page.level+1
479479
lft = page.lft
480480
rght = page.rght
481-
482-

0 commit comments

Comments
 (0)