summaryrefslogtreecommitdiff
path: root/pycodestyle.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | Make W605 point to the invalid sequenceMarius Gedminas2018-11-221-2/+7
| | | | | | | | | | | | | | Instead of having W605 point to the beginning of the string literal, make it point to the precise line and column of the invalid escape sequence. This is more helpful when you have multiline string literals.
* | Fix line offset for 'invalid escape sequence'Anthony Sottile2018-10-201-1/+2
|/
* Comment spelling fixVille Skyttä2018-07-071-1/+1
|
* Remove support for EOL Python 2.6 and 3.3Jon Dufresne2018-06-021-26/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python 2.6 an 3.3 are end of life. They are no longer receiving bug fixes, including for security issues. Python 2.6 went EOL on 2013-10-29 and 3.3 on 2017-09-29. For additional details on support Python versions, see: https://devguide.python.org/#status-of-python-branches Removing support for EOL Pythons will reduce testing and maintenance resources. Removed all workarounds for older Pythons. Updated trove classifiers and documentation to better communicate supported Python versions. Additionally, pass python_requires argument to setuptools. Helps pip decide what version of the library to install. https://packaging.python.org/tutorials/distributing-packages/#python-requires > If your project only runs on certain Python versions, setting the > python_requires argument to the appropriate PEP 440 version specifier > string will prevent pip from installing the project on other Python > versions. https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords > python_requires > > A string corresponding to a version specifier (as defined in PEP 440) > for the Python version, used to specify the Requires-Python defined in > PEP 345. Can now use more modern Python syntax including dictionary comprehension as well as more generators. Closes #755
* Merge pull request #751 from hhatto/w504-positionIan Stapleton Cordasco2018-05-191-2/+3
|\ | | | | Change the position pointed out by W504
| * rename variablehhatto2018-04-141-3/+3
| |
| * Change the position pointed out by W504hhatto2018-04-141-2/+3
| |
* | Pydoc fixes to support W505 in self-checksBrian Van Klaveren2018-05-111-110/+128
| |
* | Implement W505 - Max Doc Length checkBrian Van Klaveren2018-05-111-4/+65
| |
* | Fix detection of annotated argument defaultsJimmy Jia2018-04-181-6/+6
|/ | | | | This improves E252 to allow default arguments like `_default(f=1)`. Closes gh-753
* Merge pull request #747 from hhatto/w605-positionIan Stapleton Cordasco2018-04-121-1/+1
|\ | | | | Change the position pointed out by W605
| * Change the position pointed out by W605hhatto2018-04-121-1/+1
| |
* | Fix flake8 test environmentIan Stapleton Cordasco2018-04-121-3/+3
|/
* Release v2.4.02.4.0Ian Stapleton Cordasco2018-04-101-1/+1
|
* Add variables so blank lines may be configuresAdi Roiban2018-04-081-14/+34
| | | | | | | | This adds some module level configuration points for users to define how many blank lines they want in their code. It paves the way for someone to develop a flake8 plugin to configure this in pycodestyle. Fixes #732
* Ignore length of shebang line (#736)Jimi Cullen2018-04-031-1/+5
| | | | | | | | * Add special case to maximum_line_length to ignore long shebang lines. * Add test for ignoring long shebang lines. * Clean up shebang line check.
* Finalize support for Python 3.7Adi Roiban2018-03-241-2/+2
| | | | | | | | Python 3.7 added a warning for a future feature of nested regular expressions. To avoid this warning we escape what is not a nested regex. This also keeps track of the `async` keyword and handles it appropriately. Closes gh-728
* Merge pull request #684 from jdufresne/async-awaitIan Stapleton Cordasco2018-02-171-0/+54
|\ | | | | Add W606 warning for async and await keywords in Python 3.7
| * Add W606 warning for async and await keywords in Python 3.7Jon Dufresne2017-09-301-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From https://docs.python.org/3/whatsnew/3.6.html#new-keywords > async and await are not recommended to be used as variable, class, > function or module names. Introduced by PEP 492 in Python 3.5, they > will become proper keywords in Python 3.7. Starting in Python 3.6, the > use of async or await as names will generate a DeprecationWarning. By adding a warning to pycodestyle.py these future warnings and syntax errors can be caught during static code analysis. The await expression tests were taken from PEP-492. https://www.python.org/dev/peps/pep-0492/#id58
* | Merge pull request #717 from taion/annot-missing-spaceIan Stapleton Cordasco2018-01-241-5/+20
|\ \ | | | | | | Add E252 on missing whitespace for annotated parameter defaults
| * | Add E252 on missing whitespace for annotated parameter defaultsJimmy Jia2017-12-161-5/+20
| | |
* | | Fixed wording in docstringIan Lee2018-01-191-2/+2
| | |
* | | Fix up testsuite for W504Ian Stapleton Cordasco2018-01-171-12/+12
| | |
* | | Add W504 for line breaks before binary operatorsIan Cordasco2018-01-171-28/+81
| | | | | | | | | | | | | | | | | | This flips the W503 rule to enforce line breaks before binary operators. Related #498
* | | Fix handling of diffs with mnemonic prefixesMichal Kolodziejski2017-12-271-1/+3
|/ /
* | Merge pull request #663 from mjsir911/mergeIan Stapleton Cordasco2017-11-181-2/+7
|\ \ | | | | | | Allow continuation of verbosity level
| * | Default `verbose` to `None` instead of `0`Marco Sirabella2017-10-221-1/+1
| | |
| * | Handle conflicting CLI and verbose=# betterMarco Sirabella2017-10-221-2/+3
| | |
| * | Transform booleans to numbers to go with previous codeMarco Sirabella2017-10-221-2/+2
| | |
| * | - Forward down verbosity levelMarco J Sirabella2017-07-091-2/+6
| | |
* | | Fix missed quoting in E722 checkDirk Mueller2017-10-241-1/+1
| |/ |/| | | | | | | | | | | | | | | | | The warning looks fairly odd: E722 do not use bare except' change this to E722 do not use bare 'except'
* | Add W605 warning for invalid escape sequences in string literalsJon Dufresne2017-09-101-0/+51
|/ | | | | | | | | | | | | | | | | | | Starting with Python 3.6, invalid escape sequences in string literals are now deprecated. In a future version of Python, invalid escape sequences will be a syntax error. While this deprecation produces a runtime warning, it only appears if warnings are enabled and the first time the Python source is compiled to byte code. By adding a check to pycodestyle, projects can take advantage of static analysis to catch and fix these future syntax errors. For more information on the deprecation, see the Python release notes, https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior > A backslash-character pair that is not a valid escape sequence now > generates a DeprecationWarning. Although this will eventually become a > SyntaxError, that will not be for several Python releases. Fixes #633
* Merge branch 'master' into fix-variable-annotationsEddie Antonio Santos2017-06-071-53/+86
|\
| * Fix issue #643: Optimize noqa() with an lru_cache for Python 3.2+. (#644)Julien2017-06-031-1/+11
| | | | | | | | | | | | | | | | Had to catch a "No signature found for builtin <built-in method search of _sre.SRE_Pattern object at 0x...>" in 3.4: In python3.4 the search was not detected as a function, now that it's wrapped in an lru_cache it is, yet it still has no signature (it has in 3.5+).
| * Merge pull request #625 from scop/py36escseqIan Cordasco2017-05-291-1/+1
| |\ | | | | | | Python 3.6 invalid escape sequence deprecation fix
| | * Python 3.6 invalid escape sequence deprecation fixVille Skyttä2017-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior "backslash-character pair that is not a valid escape sequence now generates a DeprecationWarning. Although this will eventually become a SyntaxError, that will not be for several Python releases."
| * | Use bisect instead of iterating over every offsets.Julien Palard2017-05-141-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the offsets looks already sorted (which looks logical so I assumed they always are), using a bisection if faster than iterating over all of them. On a specific test I encontered, I got nice enhancement with this patch: $ time python3 ./pycodestyle.py ~/Downloads/PmagPy/PmagPy/coefficients-552K.py > /dev/null real 1m16.405s $ time python3 ./pycodestyle.py ~/Downloads/PmagPy/PmagPy/coefficients-552K.py > /dev/null real 0m3.318s
| * | Avoid relying on inspect to list functions.Julien Palard2017-05-091-45/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allow to run python3 -m cProfile ./pycodestyle.py …. Otherwise, as cProfile looks to wrap every functions (in a way I did not studied in depth), the inspection of test function found no function, and no test were run while running under cProfile, meaning that: $ time python3 ./pycodestyle.py coefficients-148K.py [loads and loads of errors properly reported] real 0m4.712s user 0m4.684s sys 0m0.024s $ time python3 -m cProfile ./pycodestyle.py /home/mdk/Downloads/pystyle/stats/git-clones/PmagPy/PmagPy/coefficients-148K.py [no error reported as no check were found by inspection] real 0m0.447s user 0m0.436s sys 0m0.008s With this patch: $ time python3 -m cProfile ./pycodestyle.py /home/mdk/Downloads/pystyle/stats/git-clones/PmagPy/PmagPy/coefficients-148K.py [loads and loads of errors properly reported] real 0m4.889s user 0m4.852s sys 0m0.032s
| * | Correctly report E501 when the first line of a docstring is too longAnthony Sottile2017-03-151-2/+4
| |/ | | | | | | Resolves #622
* | Fix erroneous regex repetition.Eddie Antonio Santos2017-04-151-1/+1
| |
* | update patchRach Belaid2017-04-061-2/+2
| |
* | Support variable annotation when variable start by a keywordRach Belaid2017-03-221-1/+1
|/ | | | | | | Support case when the variable name start by a keyword, eg: ``` class Test: formula: str = None ```
* Bump version for 2.3.12.3.1Ian Cordasco2017-01-301-1/+1
| | | | Add release notes for 2.3.1 as well
* Allow for multiple spaces in top level regexIan Cordasco2017-01-301-1/+1
|
* Fix regression in E302 detectionIan Cordasco2017-01-301-1/+1
| | | | | | | | This was similar to an issue we had with E306 in which we were only checking that a line started with "def" or "class" which catches global vars like "defaults" or "classification". Closes gh-617
* Prepare 2.3.0 releaseIan Cordasco2017-01-271-1/+1
|
* Allow all dunder variables above importsSimon Gomizelj2017-01-251-0/+3
| | | | Closes #394
* Merge pull request #610 from khairihafsham/e306-docIan Cordasco2017-01-241-0/+1
|\ | | | | added function doc to blank_lines() for E306
| * modified pycodestyle.pyKhairi Hafsham2017-01-161-0/+1
| | | | | | | | added function doc to blank_lines() for E306
* | Don't report E701 for variable annotations (#612)Anthony Sottile2017-01-241-1/+12
| |