diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index dc334a2..8f0dc78 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -26,5 +26,5 @@ Use 'x' to check each item: [x] I have ... * [ ] I have opened this pull request against ``master`` * [ ] I have added or modified the tests when changing logic * [ ] I have followed [the conventional commits guidelines](https://www.conventionalcommits.org/) to add meaningful information into the changelog -* [ ] 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 +* [ ] 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 [Slack](https://www.django-cms.org/slack) to find a “pr review buddy” who is going to review my pull request. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0f90806 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,47 @@ +ci: + autofix_commit_msg: | + ci: auto fixes from pre-commit hooks + for more information, see https://pre-commit.ci + autofix_prs: false + autoupdate_commit_msg: 'ci: pre-commit autoupdate' + autoupdate_schedule: monthly + +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: check-merge-conflict + - id: debug-statements + - id: mixed-line-ending + - id: trailing-whitespace +- repo: https://github.com/asottile/pyupgrade + rev: v3.2.0 + hooks: + - id: pyupgrade + args: ["--py37-plus"] +- repo: https://github.com/adamchainz/django-upgrade + rev: '1.4.0' + hooks: + - id: django-upgrade + args: [--target-version, "2.2"] +- repo: https://github.com/PyCQA/flake8 + rev: 4.0.1 + hooks: + - id: flake8 +- repo: https://github.com/asottile/yesqa + rev: v1.3.0 + hooks: + - id: yesqa +- repo: https://github.com/pycqa/isort + rev: 5.10.1 + hooks: + - id: isort +- repo: https://github.com/codespell-project/codespell + rev: v2.1.0 + hooks: + - id: codespell + args: ["--ignore-words-list", "ist, oder, alle"] diff --git a/LICENSE b/LICENSE index c1917a7..0a4a724 100644 --- a/LICENSE +++ b/LICENSE @@ -21,4 +21,4 @@ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.rst b/README.rst index fa705ce..2740a1a 100644 --- a/README.rst +++ b/README.rst @@ -8,10 +8,10 @@ django CMS Transfer and import plugin data from a page or a placeholder. It does not support foreign key relations and won't import/export related data, such as `media `_. -.. note:: - +.. note:: + This project is endorsed by the `django CMS Association `_. - That means that it is officially accepted by the dCA as being in line with our roadmap vision and development/plugin policy. + That means that it is officially accepted by the dCA as being in line with our roadmap vision and development/plugin policy. Join us on `Slack `_. .. image:: preview.gif @@ -23,8 +23,8 @@ Contribute to this project and win rewards Because this is a an open-source project, we welcome everyone to `get involved in the project `_ and -`receive a reward `_ for their contribution. -Become part of a fantastic community and help us make django CMS the best CMS in the world. +`receive a reward `_ for their contribution. +Become part of a fantastic community and help us make django CMS the best CMS in the world. We'll be delighted to receive your feedback in the form of issues and pull requests. Before submitting your diff --git a/djangocms_transfer/cms_plugins.py b/djangocms_transfer/cms_plugins.py index 487516a..f497ec9 100644 --- a/djangocms_transfer/cms_plugins.py +++ b/djangocms_transfer/cms_plugins.py @@ -27,10 +27,6 @@ def get_plugin_urls(self): ] return urlpatterns - def get_extra_placeholder_menu_items(self, request, placeholder): # noqa - # django-cms 3.4 compatibility - return self.get_extra_placeholder_menu_items(request, placeholder) - def get_extra_global_plugin_menu_items(self, request, plugin): # django-cms 3.4 compatibility return self.get_extra_plugin_menu_items(request, plugin) @@ -65,7 +61,7 @@ def get_extra_plugin_menu_items(cls, request, plugin): ), ] - @classmethod # noqa + @classmethod def get_extra_placeholder_menu_items(cls, request, placeholder): # noqa data = urlencode({ 'language': get_language_from_request(request), @@ -176,7 +172,7 @@ def export_plugins_view(cls, request): # TODO: Check permissions filename = form.get_filename() response = HttpResponse(form.run_export(), content_type='application/json') - response['Content-Disposition'] = 'attachment; filename={}'.format(filename) + response['Content-Disposition'] = f'attachment; filename={filename}' return response diff --git a/djangocms_transfer/locale/de/LC_MESSAGES/django.po b/djangocms_transfer/locale/de/LC_MESSAGES/django.po index 7105200..b571539 100644 --- a/djangocms_transfer/locale/de/LC_MESSAGES/django.po +++ b/djangocms_transfer/locale/de/LC_MESSAGES/django.po @@ -2,10 +2,10 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# # Translators: # Angelo Dini , 2019 -# +# #, fuzzy msgid "" msgstr "" diff --git a/djangocms_transfer/locale/es/LC_MESSAGES/django.po b/djangocms_transfer/locale/es/LC_MESSAGES/django.po index d464bae..f966f4f 100644 --- a/djangocms_transfer/locale/es/LC_MESSAGES/django.po +++ b/djangocms_transfer/locale/es/LC_MESSAGES/django.po @@ -2,7 +2,7 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# #, fuzzy msgid "" msgstr "" diff --git a/djangocms_transfer/locale/fr/LC_MESSAGES/django.po b/djangocms_transfer/locale/fr/LC_MESSAGES/django.po index 0932b21..18cdd03 100644 --- a/djangocms_transfer/locale/fr/LC_MESSAGES/django.po +++ b/djangocms_transfer/locale/fr/LC_MESSAGES/django.po @@ -2,7 +2,7 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# #, fuzzy msgid "" msgstr "" diff --git a/tests/test_migrations.py b/tests/test_migrations.py index 3fd6a1e..14c8feb 100644 --- a/tests/test_migrations.py +++ b/tests/test_migrations.py @@ -27,5 +27,5 @@ def test_for_missing_migrations(self): # the "no changes" exit code is 0 status_code = "0" - if status_code == "1": - self.fail("There are missing migrations:\n {}".format(output.getvalue())) + if status_code == '1': + self.fail(f'There are missing migrations:\n {output.getvalue()}')