Skip to content

Conversation

SylvainDe
Copy link
Owner

No description provided.

Darioush Jalalinasab and others added 30 commits December 18, 2014 00:50
At time of writing, these tests fail. If this is later fixed, someone
may wish to remove this warning!
…xibility

Multi-line ignore parsing in config_file
Update all documentation and links to use PyCQA
Add a notification for the PyCQA channel
Fix regression in catching E711 (issue #435), add tests
Closes #452 - Mention `ignore` in Error codes and not Configuration
The two versions of parameter parsing were not, in fact, equivalent. The
return types of `inspect.signature` and `inspect.getargspec` are, in
fact, subtly different.

See:
    * https://docs.python.org/3/library/inspect.html#inspect.signature
    * praw-dev/praw#541 (comment)
On Python 3, when python3 with run with -bb, comparison between bytes
and str raises a BytesWarning exception. Test the Python version
instead of testing '' == b''.
fix BytesWarning on Python 3
sigmavirus24 and others added 29 commits January 27, 2017 14:58
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
Fix regression in E302 detection
The bug was already fixed since it also affected E302 but this adds a
test to ensure it doesn't regress for nested definitions either.

Closes gh-619
Add regression test for nested definitions
Add release notes for 2.3.1 as well
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."
Support case when the variable name start by a keyword, eg:
```
class Test:
    formula: str = None
```
…ng_622

Correctly report E501 when the first line of a docstring is too long
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
Avoid relying on inspect to list functions.
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
Use bisect instead of iterating over every offsets.
Python 3.6 invalid escape sequence deprecation fix
Users' global .gitattributes files may attempt to auto-fix certain files.
)

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+).
@SylvainDe SylvainDe merged commit bf1d40c into SylvainDe:master Jun 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.