Wykres commitów

29 Commity (adfd8b32dc0545a1a1357dc049240ca88067412c)

Autor SHA1 Wiadomość Data
Oli 459fbb2cc9 Switch to ruff for flake8 / isort code checking (#10324) 2023-04-21 11:58:27 +01:00
Dan Braghis 6dae6e5d07 Add and configure black
This:
- updates the pre-commit configuration and setup.py testing dependencies
- updates isort/flake8 configuration for black
- adds black linting to Makefile and CircleCI configuration
- updates editorconfig with the new line length (88) for py files
- updates python guidelines in docs
2022-02-15 13:06:17 +00:00
Thibaud Colas 7523d65d84 Fix caching setup for Python dependencies in CircleCI 2022-01-08 21:54:46 +10:00
Tibor Leupold 71829dac77 Ignore venv during in isort 2021-02-23 10:14:01 +00:00
Matt Westcott 878f2784cb Add config section for doc8 in setup.cfg and ignore _build dir 2020-10-21 12:39:32 +01:00
Matt Westcott 9947b955da Lint config fixes (#6473)
Ref #6463, #6428

* pin isort to 5.6.4
* update isort version mentioned in python_guidelines.rst
* make lint commands consistent between make lint and circleci
* fix isort errors on files outside of /wagtail
* speed up isort by ignoring additional directories and filetypes
2020-10-19 21:33:10 +01:00
Dan Braghis 5c05fc7d8e Bump isort requirement for testing and update configuration 2020-10-16 18:56:39 +01:00
Karl Hobley f2dfff8061 Flake8 all other Python files 2020-10-05 14:27:50 +01:00
Karl Hobley 8eb895347a Don't ignore flake8 errors D200 through D402
D200: One-line docstring should fit on one line with quotes
D202: No blank lines allowed after function docstring
D204: 1 blank line required after docstring
D205: 1 blank line required between summary line and description
D209: Multi-line docstring closing quotes should be on a separate line

No occurances of any of these exist in Wagtail at the moment
2020-08-11 13:15:28 +01:00
Karl Hobley 64d5fe0b66 Stop ignoring Flake8 `First argument of a method should be named 'self'`
Already no breakages of this rule in the whole of Wagtail!
2020-08-11 13:15:28 +01:00
Karl Hobley 2c8ec6336a Fix all `E303: Too many blank lines` Flake8 errors
I think this is quite a useful rule to have. It makes flake8 check that the spacing between module level things and class methods are consistent.
2020-08-11 11:28:10 +01:00
Karl Hobley 514bc7de20 Make isort see unknown modules as third party by default 2020-07-24 16:59:33 +01:00
Matt Westcott 6ce9f3a717 Unbundle the l18n library
This was previously bundled in #4721 to avoid installation errors on non-Unicode locales. As of v2018.5, this has now been fixed upstream: https://bitbucket.org/tkhyn/l18n/issues/4/setuppy-raises-unicodedecodeerror-trying

isort fix
2019-10-30 08:03:41 +10:00
Sergey Fedoseev eab9198f4c Move flake8 config to setup.cfg 2019-10-23 18:09:07 +02:00
Matt Westcott 33e290b82d Fix linting failures for flake8 3.6 2018-10-25 18:03:29 +01:00
Matt Westcott a34c87f080 Exclude wagtail/utils/l18n from linting 2018-08-06 12:39:45 +01:00
Michael van Tellingen 967ead38a3 Use tool:pytest in setup.cfg to fix warning message when running pytest 2018-04-08 06:57:43 +02:00
Mikalai Radchuk b36d7cabb3 Update setup.cfg to drop support of Python 2 2017-11-30 11:14:45 +00:00
Mads Jensen 8b420b9abc Removed __future__ imports
Also delete add_imports directive from isort configuration
2017-11-27 02:18:30 +00:00
Karl Hobley cecbfbf32d Extend known_third_party to include all other third party modules
isort's auto detection of third party modules seems to be quite flaky.
This should stop it making any mistakes.
2017-05-26 13:20:06 +01:00
Karl Hobley 7fe1cc4f0c Set known_{first,third}_party isort settings 2017-05-26 13:03:41 +01:00
Karl Hobley c83a8a0a67 Fix import sorting in project_template
In a rendered project, the "search" import is local but it was being
treated as third party by isort.
2017-05-26 13:03:41 +01:00
Matt Westcott b85c340163 Move flake8 config to setup.cfg 2016-06-23 16:31:44 +01:00
Michael van Tellingen d82e38e11e Implement support for using pytest (#2735)
This adds a conftest.py module to setup the test infrastructure
correctly. It doesn't yet add pytest and pytest-django to the testing
requirements so for now it is completly optional.

This change also updates the test_migrations testcase to use a regular
TestCase baseclass instead of the TransactionTestCase. Otherwise the
following tests fail with db errors.
2016-06-17 15:06:21 +01:00
Tim Heap a0af3d6685 Ensure absolute_import, unicode_literals imported in all files
Drone will now check that

    from __future__ absolute_import, unicode_literals

is part of every Python source file, to ensure a consistent experience
across all versions of Python.

See #2392 for an instance where missing `unicode_literals` was causing
problems.

Add missing absolute_import, unicode_literals to all files

Explicitly ensure strings are of the correct types

Now that unicode_literals is in every file, some things that used to
be py2 `str`s were now `unicode` instead. This caused issues with
generated class / function names, which must be `str` in all versions of
Python. This means bytes in py2, and unicode in py3. A test also checked
for the incorrect type of SafeString. HTML content should always be
unicode, so this has been fixed.
2016-04-03 13:11:48 +03:00
Tim Heap 31972dfd9e Check imports with isort on drone 2016-03-11 10:47:59 +00:00
Karl Hobley 7a0b51c2d6 Use universal wheel files 2015-06-03 10:08:21 +01:00
Karl Hobley 7bbde20c95 Don't make universal wheel files
The wheel file for Python 2 and Python 3 need to be slightly different as unicodecsv cannot be a dependency when using Python 3 (issue #1295)
2015-05-20 10:56:56 +01:00
Karl Hobley 486565332e Add setup.cfg for python wheels
See http://pythonwheels.com/

We support both Python 2 and Python 3 so setting universal to 1 tells wheel to make one file for both
2015-05-20 10:44:47 +01:00