Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29342824: Issue 4044 - Added handling for __future__ unicode_literals import to check_quotes() (Closed)

Created:
May 19, 2016, 9:57 p.m. by Jon Sonesen
Modified:
June 3, 2016, 4:46 a.m.
Visibility:
Public.

Description

Issue 4044 - Added handling for __future__ unicode_literals import to check_quotes() Repository: hg.adblockplus.org/codingtools/

Patch Set 1 #

Total comments: 6

Patch Set 2 : rebase and logic error fixes #

Total comments: 6

Patch Set 3 : handling for new warning A112 added #

Total comments: 15

Patch Set 4 : Changed yield spacing, and moved check to above pytohn 3+ check and makes A112 yield with othe codes #

Patch Set 5 : Changed tests for new A109 merge #

Patch Set 6 : removed 'r' prefix check #

Total comments: 2

Patch Set 7 : Updates readme for clarity, moves unicode prefix check out of single line and docstring if statemen… #

Total comments: 9

Patch Set 8 : merged edge case fix #

Total comments: 11

Patch Set 9 : changed logical if else to match suggestion from sebastian #

Total comments: 1

Patch Set 10 : removed redundant comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -26 lines) Patch
M flake8-abp/README.md View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M flake8-abp/flake8_abp.py View 1 2 3 4 5 6 7 8 9 1 chunk +29 lines, -15 lines 0 comments Download
M flake8-abp/tests/A109.py View 1 2 3 4 5 1 chunk +0 lines, -8 lines 0 comments Download
M flake8-abp/tests/A110.py View 1 2 3 4 5 6 7 1 chunk +0 lines, -3 lines 0 comments Download
A flake8-abp/tests/A110_unicode_literals.py View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
A flake8-abp/tests/A112.py View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 37
Jon Sonesen
May 19, 2016, 9:58 p.m. (2016-05-19 21:58:03 UTC) #1
Sebastian Noack
https://codereview.adblockplus.org/29342824/diff/29342825/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29342825/flake8-abp/flake8_abp.py#newcode380 flake8-abp/flake8_abp.py:380: is_unicode_literals = False While I didnt test this change ...
May 20, 2016, 12:04 a.m. (2016-05-20 00:04:34 UTC) #2
Jon Sonesen
https://codereview.adblockplus.org/29342824/diff/29342825/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29342825/flake8-abp/flake8_abp.py#newcode386 flake8-abp/flake8_abp.py:386: if token is 'unicode_literals': On 2016/05/20 00:04:34, Sebastian Noack ...
May 20, 2016, 2 a.m. (2016-05-20 02:00:01 UTC) #3
Vasily Kuznetsov
Hi Jon, The logic is right now, but the check for unicode_literals mode is not ...
May 20, 2016, 8:46 a.m. (2016-05-20 08:46:25 UTC) #4
Sebastian Noack
https://codereview.adblockplus.org/29342824/diff/29342828/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29342828/flake8-abp/flake8_abp.py#newcode414 flake8-abp/flake8_abp.py:414: elif is_unicode or is_unicode_literals: Perhaps we should generate a ...
May 20, 2016, 1:48 p.m. (2016-05-20 13:48:02 UTC) #5
Vasily Kuznetsov
https://codereview.adblockplus.org/29342824/diff/29342828/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29342828/flake8-abp/flake8_abp.py#newcode414 flake8-abp/flake8_abp.py:414: elif is_unicode or is_unicode_literals: On 2016/05/20 13:48:01, Sebastian Noack ...
May 23, 2016, 8:51 a.m. (2016-05-23 08:51:15 UTC) #6
Sebastian Noack
https://codereview.adblockplus.org/29342824/diff/29342828/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29342828/flake8-abp/flake8_abp.py#newcode414 flake8-abp/flake8_abp.py:414: elif is_unicode or is_unicode_literals: On 2016/05/23 08:51:14, Vasily Kuznetsov ...
May 24, 2016, 12:41 p.m. (2016-05-24 12:41:35 UTC) #7
Vasily Kuznetsov
https://codereview.adblockplus.org/29342824/diff/29342828/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29342828/flake8-abp/flake8_abp.py#newcode414 flake8-abp/flake8_abp.py:414: elif is_unicode or is_unicode_literals: On 2016/05/24 12:41:35, Sebastian Noack ...
May 24, 2016, 1:02 p.m. (2016-05-24 13:02:43 UTC) #8
Jon Sonesen
On 2016/05/24 13:02:43, Vasily Kuznetsov wrote: > https://codereview.adblockplus.org/29342824/diff/29342828/flake8-abp/flake8_abp.py > File flake8-abp/flake8_abp.py (right): > > https://codereview.adblockplus.org/29342824/diff/29342828/flake8-abp/flake8_abp.py#newcode414 ...
May 24, 2016, 10:06 p.m. (2016-05-24 22:06:37 UTC) #9
Sebastian Noack
https://codereview.adblockplus.org/29342824/diff/29343019/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29343019/flake8-abp/flake8_abp.py#newcode47 flake8-abp/flake8_abp.py:47: IS_UNICODE_LITERALS = False Uppercase notation is only for variables ...
May 25, 2016, 8:31 a.m. (2016-05-25 08:31:36 UTC) #10
Vasily Kuznetsov
https://codereview.adblockplus.org/29342824/diff/29343019/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29343019/flake8-abp/flake8_abp.py#newcode384 flake8-abp/flake8_abp.py:384: # --- check if this is beginning of file ...
May 25, 2016, 1:55 p.m. (2016-05-25 13:55:32 UTC) #11
Sebastian Noack
https://codereview.adblockplus.org/29342824/diff/29343019/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29343019/flake8-abp/flake8_abp.py#newcode389 flake8-abp/flake8_abp.py:389: token_strings = [t[1] for t in tokens] On 2016/05/25 ...
May 25, 2016, 2:45 p.m. (2016-05-25 14:45:30 UTC) #12
Vasily Kuznetsov
https://codereview.adblockplus.org/29342824/diff/29343019/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29343019/flake8-abp/flake8_abp.py#newcode389 flake8-abp/flake8_abp.py:389: token_strings = [t[1] for t in tokens] On 2016/05/25 ...
May 25, 2016, 4:25 p.m. (2016-05-25 16:25:57 UTC) #13
Jon Sonesen
On 2016/05/25 16:25:57, Vasily Kuznetsov wrote: > https://codereview.adblockplus.org/29342824/diff/29343019/flake8-abp/flake8_abp.py > File flake8-abp/flake8_abp.py (right): > > https://codereview.adblockplus.org/29342824/diff/29343019/flake8-abp/flake8_abp.py#newcode389 ...
May 26, 2016, 3:22 p.m. (2016-05-26 15:22:12 UTC) #14
Jon Sonesen
Also, for this commit I didn't merge the A109 and A112 checks yet.
May 26, 2016, 3:26 p.m. (2016-05-26 15:26:57 UTC) #15
Vasily Kuznetsov
Looking good! A couple more things to adjust. https://codereview.adblockplus.org/29342824/diff/29344635/flake8-abp/README.md File flake8-abp/README.md (right): https://codereview.adblockplus.org/29342824/diff/29344635/flake8-abp/README.md#newcode36 flake8-abp/README.md:36: * ...
May 26, 2016, 7:29 p.m. (2016-05-26 19:29:45 UTC) #16
Sebastian Noack
https://codereview.adblockplus.org/29342824/diff/29344649/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (left): https://codereview.adblockplus.org/29342824/diff/29344649/flake8-abp/flake8_abp.py#oldcode391 flake8-abp/flake8_abp.py:391: if first_token and re.search(r'^(?:(?:def|class)\s|$)', Since this is not an ...
May 27, 2016, 12:13 p.m. (2016-05-27 12:13:56 UTC) #17
Sebastian Noack
https://codereview.adblockplus.org/29342824/diff/29344649/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29344649/flake8-abp/flake8_abp.py#newcode47 flake8-abp/flake8_abp.py:47: is_unicode_literals = False has_unicode_literals seems to be more correct ...
May 27, 2016, 12:33 p.m. (2016-05-27 12:33:48 UTC) #18
Sebastian Noack
https://codereview.adblockplus.org/29342824/diff/29344649/flake8-abp/README.md File flake8-abp/README.md (right): https://codereview.adblockplus.org/29342824/diff/29344649/flake8-abp/README.md#newcode36 flake8-abp/README.md:36: * `A112`: Use "from __future__ import unicode_literals" instead of ...
May 29, 2016, 12:17 p.m. (2016-05-29 12:17:40 UTC) #19
Jon Sonesen
fixes for flake8 unicode literals
May 31, 2016, 7:41 p.m. (2016-05-31 19:41:58 UTC) #20
Jon Sonesen
rebased changeset
May 31, 2016, 8:15 p.m. (2016-05-31 20:15:43 UTC) #21
Jon Sonesen
merged changes from edge case fix, adds non global state var had to revert to ...
May 31, 2016, 9:53 p.m. (2016-05-31 21:53:41 UTC) #22
Sebastian Noack
https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py#newcode382 flake8-abp/flake8_abp.py:382: checker_state['has_unicode_literals'] = False Awesome that we can avoid the ...
June 1, 2016, 9:37 a.m. (2016-06-01 09:37:53 UTC) #23
Vasily Kuznetsov
See comments below. Also definitely agree with Sebastian about simplifying the A112 test, both parts ...
June 1, 2016, 11:01 a.m. (2016-06-01 11:01:32 UTC) #24
Sebastian Noack
https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py#newcode413 flake8-abp/flake8_abp.py:413: elif start[0] != end[0]: On 2016/06/01 11:01:32, Vasily Kuznetsov ...
June 1, 2016, 11:05 a.m. (2016-06-01 11:05:02 UTC) #25
Vasily Kuznetsov
https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py#newcode413 flake8-abp/flake8_abp.py:413: elif start[0] != end[0]: On 2016/06/01 11:05:01, Sebastian Noack ...
June 1, 2016, 11:34 a.m. (2016-06-01 11:34:32 UTC) #26
Jon Sonesen
https://codereview.adblockplus.org/29342824/diff/29344649/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29344649/flake8-abp/flake8_abp.py#newcode391 flake8-abp/flake8_abp.py:391: if 'unicode_literals' in token_strings: On 2016/05/27 12:13:55, Sebastian Noack ...
June 1, 2016, 5:07 p.m. (2016-06-01 17:07:01 UTC) #27
Jon Sonesen
https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py#newcode425 flake8-abp/flake8_abp.py:425: elif is_unicode or has_unicode_literals and not is_bytes: On 2016/06/01 ...
June 1, 2016, 5:14 p.m. (2016-06-01 17:14:04 UTC) #28
Jon Sonesen
simmplified the tests, fixed a112 check and removed extra vars
June 1, 2016, 6:10 p.m. (2016-06-01 18:10:51 UTC) #29
Jon Sonesen
https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py#newcode425 flake8-abp/flake8_abp.py:425: elif is_unicode or has_unicode_literals and not is_bytes: On 2016/06/01 ...
June 2, 2016, 1:14 a.m. (2016-06-02 01:14:10 UTC) #30
Jon Sonesen
On 2016/06/02 01:14:10, Jon Sonesen wrote: > https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py > File flake8-abp/flake8_abp.py (right): > > https://codereview.adblockplus.org/29342824/diff/29345461/flake8-abp/flake8_abp.py#newcode425 ...
June 2, 2016, 1:16 a.m. (2016-06-02 01:16:18 UTC) #31
Jon Sonesen
changed logical if else to match suggestion from sebastian
June 2, 2016, 1:18 a.m. (2016-06-02 01:18:17 UTC) #32
Sebastian Noack
It looks mostly good to me. Just one more minor comment. https://codereview.adblockplus.org/29342824/diff/29345517/flake8-abp/flake8_abp.py File flake8-abp/flake8_abp.py (right): ...
June 2, 2016, 11:41 a.m. (2016-06-02 11:41:01 UTC) #33
Vasily Kuznetsov
On 2016/06/02 11:41:01, Sebastian Noack wrote: > It looks mostly good to me. Just one ...
June 2, 2016, 11:53 a.m. (2016-06-02 11:53:54 UTC) #34
Jon Sonesen
removed redundant comment
June 2, 2016, 5:45 p.m. (2016-06-02 17:45:58 UTC) #35
Vasily Kuznetsov
On 2016/06/02 17:45:58, Jon Sonesen wrote: > removed redundant comment LGTM
June 2, 2016, 7:28 p.m. (2016-06-02 19:28:01 UTC) #36
Sebastian Noack
June 2, 2016, 7:30 p.m. (2016-06-02 19:30:52 UTC) #37
LGTM

Powered by Google App Engine
This is Rietveld