| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| | |
Change the position pointed out by W504
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
This improves E252 to allow default arguments like `_default(f=1)`.
Closes gh-753
|
|\
| |
| | |
Change the position pointed out by W605
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
* Add special case to maximum_line_length to ignore long shebang lines.
* Add test for ignoring long shebang lines.
* Clean up shebang line check.
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| | |
Add W606 warning for async and await keywords in Python 3.7
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \
| | |
| | | |
Add E252 on missing whitespace for annotated parameter defaults
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
This flips the W503 rule to enforce line breaks before binary operators.
Related #498
|
|/ / |
|
|\ \
| | |
| | | |
Allow continuation of verbosity level
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| | |
The warning looks fairly odd:
E722 do not use bare except'
change this to
E722 do not use bare 'except'
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
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+).
|
| |\
| | |
| | | |
Python 3.6 invalid escape sequence deprecation fix
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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."
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| |/
| |
| |
| | |
Resolves #622
|
| | |
|
| | |
|
|/
|
|
|
|
|
| |
Support case when the variable name start by a keyword, eg:
```
class Test:
formula: str = None
```
|
|
|
|
| |
Add release notes for 2.3.1 as well
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Closes #394
|
|\
| |
| | |
added function doc to blank_lines() for E306
|
| |
| |
| |
| | |
added function doc to blank_lines() for E306
|
| | |
|