Hello community,

here is the log from the commit of package python-flake8-quotes for 
openSUSE:Factory checked in at 2020-07-27 17:40:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-flake8-quotes (Old)
 and      /work/SRC/openSUSE:Factory/.python-flake8-quotes.new.3592 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-flake8-quotes"

Mon Jul 27 17:40:26 2020 rev:6 rq:822786 version:3.2.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-flake8-quotes/python-flake8-quotes.changes    
    2020-04-16 23:04:59.747767844 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-flake8-quotes.new.3592/python-flake8-quotes.changes
      2020-07-27 17:41:13.103045907 +0200
@@ -1,0 +2,10 @@
+Sat Jul 25 15:27:54 UTC 2020 - Arun Persaud <[email protected]>
+
+- update to version 3.2.0:
+  * Fixed mistaking key access as docstring (#99)
+  * Added lint checks for main files (#79)
+
+- changes from version 3.1.0:
+  * Added quadruple quote ending support (#96)
+
+-------------------------------------------------------------------

Old:
----
  flake8-quotes-3.0.0.tar.gz

New:
----
  flake8-quotes-3.2.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-flake8-quotes.spec ++++++
--- /var/tmp/diff_new_pack.qI51qY/_old  2020-07-27 17:41:15.739048381 +0200
+++ /var/tmp/diff_new_pack.qI51qY/_new  2020-07-27 17:41:15.743048385 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-flake8-quotes
-Version:        3.0.0
+Version:        3.2.0
 Release:        0
 Summary:        Flake8 lint for quotes
 License:        MIT

++++++ flake8-quotes-3.0.0.tar.gz -> flake8-quotes-3.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/flake8-quotes-3.0.0/PKG-INFO 
new/flake8-quotes-3.2.0/PKG-INFO
--- old/flake8-quotes-3.0.0/PKG-INFO    2020-03-25 21:43:48.000000000 +0100
+++ new/flake8-quotes-3.2.0/PKG-INFO    2020-05-13 01:46:27.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: flake8-quotes
-Version: 3.0.0
+Version: 3.2.0
 Summary: Flake8 lint for quotes.
 Home-page: http://github.com/zheller/flake8-quotes/
 Author: Zachary Wright Heller
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/flake8-quotes-3.0.0/flake8_quotes/__about__.py 
new/flake8-quotes-3.2.0/flake8_quotes/__about__.py
--- old/flake8-quotes-3.0.0/flake8_quotes/__about__.py  2020-03-25 
21:43:39.000000000 +0100
+++ new/flake8-quotes-3.2.0/flake8_quotes/__about__.py  2020-05-13 
01:46:18.000000000 +0200
@@ -1 +1 @@
-__version__ = '3.0.0'
+__version__ = '3.2.0'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/flake8-quotes-3.0.0/flake8_quotes/__init__.py 
new/flake8-quotes-3.2.0/flake8_quotes/__init__.py
--- old/flake8-quotes-3.0.0/flake8_quotes/__init__.py   2020-03-25 
21:43:28.000000000 +0100
+++ new/flake8-quotes-3.2.0/flake8_quotes/__init__.py   2020-05-13 
01:33:13.000000000 +0200
@@ -24,51 +24,53 @@
 
     INLINE_QUOTES = {
         # When user wants only single quotes
-        '\'': {
-            'good_single': '\'',
+        "'": {
+            'good_single': "'",
             'bad_single': '"',
         },
         # When user wants only double quotes
         '"': {
             'good_single': '"',
-            'bad_single': '\'',
+            'bad_single': "'",
         },
     }
     # Provide aliases for Windows CLI support
     #   https://github.com/zheller/flake8-quotes/issues/49
-    INLINE_QUOTES['single'] = INLINE_QUOTES['\'']
+    INLINE_QUOTES['single'] = INLINE_QUOTES["'"]
     INLINE_QUOTES['double'] = INLINE_QUOTES['"']
 
     MULTILINE_QUOTES = {
-        '\'': {
-            'good_multiline': '\'\'\'',
+        "'": {
+            'good_multiline': "'''",
+            'good_multiline_ending': '\'"""',
             'bad_multiline': '"""',
         },
         '"': {
             'good_multiline': '"""',
-            'bad_multiline': '\'\'\'',
+            'good_multiline_ending': '"\'\'\'',
+            'bad_multiline': "'''",
         },
     }
     # Provide Windows CLI and multi-quote aliases
-    MULTILINE_QUOTES['single'] = MULTILINE_QUOTES['\'']
+    MULTILINE_QUOTES['single'] = MULTILINE_QUOTES["'"]
     MULTILINE_QUOTES['double'] = MULTILINE_QUOTES['"']
-    MULTILINE_QUOTES['\'\'\''] = MULTILINE_QUOTES['\'']
+    MULTILINE_QUOTES["'''"] = MULTILINE_QUOTES["'"]
     MULTILINE_QUOTES['"""'] = MULTILINE_QUOTES['"']
 
     DOCSTRING_QUOTES = {
-        '\'': {
-            'good_docstring': '\'\'\'',
+        "'": {
+            'good_docstring': "'''",
             'bad_docstring': '"""',
         },
         '"': {
             'good_docstring': '"""',
-            'bad_docstring': '\'\'\'',
+            'bad_docstring': "'''",
         },
     }
     # Provide Windows CLI and docstring-quote aliases
-    DOCSTRING_QUOTES['single'] = DOCSTRING_QUOTES['\'']
+    DOCSTRING_QUOTES['single'] = DOCSTRING_QUOTES["'"]
     DOCSTRING_QUOTES['double'] = DOCSTRING_QUOTES['"']
-    DOCSTRING_QUOTES['\'\'\''] = DOCSTRING_QUOTES['\'']
+    DOCSTRING_QUOTES["'''"] = DOCSTRING_QUOTES["'"]
     DOCSTRING_QUOTES['"""'] = DOCSTRING_QUOTES['"']
 
     def __init__(self, tree, lines=None, filename='(none)'):
@@ -102,10 +104,10 @@
                           parse_from_config=True, type='choice',
                           choices=sorted(cls.INLINE_QUOTES.keys()),
                           help='Deprecated alias for `--inline-quotes`')
-        cls._register_opt(parser, '--inline-quotes', default='\'',
+        cls._register_opt(parser, '--inline-quotes', default="'",
                           action='store', parse_from_config=True, 
type='choice',
                           choices=sorted(cls.INLINE_QUOTES.keys()),
-                          help='Quote to expect in all files (default: \')')
+                          help="Quote to expect in all files (default: ')")
         cls._register_opt(parser, '--multiline-quotes', default=None, 
action='store',
                           parse_from_config=True, type='choice',
                           choices=sorted(cls.MULTILINE_QUOTES.keys()),
@@ -126,7 +128,7 @@
         # Define our default config
         # cls.config = {good_single: ', good_multiline: ''', bad_single: ", 
bad_multiline: """}
         cls.config = {}
-        cls.config.update(cls.INLINE_QUOTES['\''])
+        cls.config.update(cls.INLINE_QUOTES["'"])
         cls.config.update(cls.MULTILINE_QUOTES['"""'])
         cls.config.update(cls.DOCSTRING_QUOTES['"""'])
 
@@ -232,6 +234,12 @@
                 if self.config['good_multiline'] in unprefixed_string:
                     continue
 
+                # If our string ends with a known good ending, then ignore it
+                #   '''foo("''') -> good (continue)
+                #     Opposite, """foo"""", would break our parser (cannot 
handle """" ending)
+                if 
unprefixed_string.endswith(self.config['good_multiline_ending']):
+                    continue
+
                 # Output our error
                 yield {
                     'message': 'Q001 Remove bad quotes from multiline string',
@@ -249,21 +257,22 @@
                 #   "This is a 'string'"     -> Good        Avoids escaped 
inner quotes
                 #   "This is a \"string\""   -> Bad (Q000)
                 #   "\"This\" is a 'string'" -> Good
-                
+
                 string_contents = unprefixed_string[1:-1]
-                
+
                 # If string preferred type, check for escapes
                 if last_quote_char == self.config['good_single']:
                     if not self.config['avoid_escape'] or 'r' in prefix:
                         continue
-                    if self.config['good_single'] in string_contents and not 
self.config['bad_single'] in string_contents:
+                    if (self.config['good_single'] in string_contents and
+                            not self.config['bad_single'] in string_contents):
                         yield {
                             'message': 'Q003 Change outer quotes to avoid 
escaping inner quotes',
                             'line': start_row,
                             'col': start_col,
                         }
                     continue
-                
+
                 # If not preferred type, only allow use to avoid escapes.
                 if not self.config['good_single'] in string_contents:
                     yield {
@@ -271,7 +280,6 @@
                         'line': start_row,
                         'col': start_col,
                     }
-        
 
 
 class Token:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/flake8-quotes-3.0.0/flake8_quotes/docstring_detection.py 
new/flake8-quotes-3.2.0/flake8_quotes/docstring_detection.py
--- old/flake8-quotes-3.0.0/flake8_quotes/docstring_detection.py        
2019-04-04 03:29:37.000000000 +0200
+++ new/flake8-quotes-3.2.0/flake8_quotes/docstring_detection.py        
2020-05-13 01:45:51.000000000 +0200
@@ -63,8 +63,14 @@
         # Count opening and closing brackets in bracket_count
         elif token.type == tokenize.OP and token.string in ['(', '[', '{']:
             bracket_count += 1
+            if state in [STATE_EXPECT_MODULE_DOCSTRING, 
STATE_EXPECT_CLASS_DOCSTRING,
+                         STATE_EXPECT_FUNCTION_DOCSTRING]:
+                state = STATE_OTHER
         elif token.type == tokenize.OP and token.string in [')', ']', '}']:
             bracket_count -= 1
+            if state in [STATE_EXPECT_MODULE_DOCSTRING, 
STATE_EXPECT_CLASS_DOCSTRING,
+                         STATE_EXPECT_FUNCTION_DOCSTRING]:
+                state = STATE_OTHER
         # The token is not one of the recognized types. If we're expecting a 
colon, then all good,
         # but if we're expecting a docstring, it would no longer be a docstring
         elif state in [STATE_EXPECT_MODULE_DOCSTRING, 
STATE_EXPECT_CLASS_DOCSTRING,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/flake8-quotes-3.0.0/flake8_quotes.egg-info/PKG-INFO 
new/flake8-quotes-3.2.0/flake8_quotes.egg-info/PKG-INFO
--- old/flake8-quotes-3.0.0/flake8_quotes.egg-info/PKG-INFO     2020-03-25 
21:43:47.000000000 +0100
+++ new/flake8-quotes-3.2.0/flake8_quotes.egg-info/PKG-INFO     2020-05-13 
01:46:27.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: flake8-quotes
-Version: 3.0.0
+Version: 3.2.0
 Summary: Flake8 lint for quotes.
 Home-page: http://github.com/zheller/flake8-quotes/
 Author: Zachary Wright Heller
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/flake8-quotes-3.0.0/test/data/docstring_not_docstrings.py 
new/flake8-quotes-3.2.0/test/data/docstring_not_docstrings.py
--- old/flake8-quotes-3.0.0/test/data/docstring_not_docstrings.py       
2019-04-04 03:29:37.000000000 +0200
+++ new/flake8-quotes-3.2.0/test/data/docstring_not_docstrings.py       
2020-05-13 01:45:51.000000000 +0200
@@ -33,4 +33,12 @@
     '''
         not a multiline docstring
     '''
-    pass
\ No newline at end of file
+    pass
+
+# https://github.com/zheller/flake8-quotes/issues/97
+def test():
+    {}["a"]
+
+
+class test:
+    {}["a"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/flake8-quotes-3.0.0/test/data/doubles_multiline_string.py 
new/flake8-quotes-3.2.0/test/data/doubles_multiline_string.py
--- old/flake8-quotes-3.0.0/test/data/doubles_multiline_string.py       
2019-04-04 03:29:37.000000000 +0200
+++ new/flake8-quotes-3.2.0/test/data/doubles_multiline_string.py       
2020-05-13 01:33:13.000000000 +0200
@@ -1,7 +1,9 @@
 s = """ This "should"
-"not" be
+be
 "linted" """
 
 s = ''' This "should"
 "not" be
-linted "either" '''
+"linted" '''
+
+s = """'This should not be linted due to having would-be quadruple end 
quote'"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/flake8-quotes-3.0.0/test/data/singles_multiline_string.py 
new/flake8-quotes-3.2.0/test/data/singles_multiline_string.py
--- old/flake8-quotes-3.0.0/test/data/singles_multiline_string.py       
2019-04-04 03:29:37.000000000 +0200
+++ new/flake8-quotes-3.2.0/test/data/singles_multiline_string.py       
2020-05-13 01:33:13.000000000 +0200
@@ -1,7 +1,9 @@
 s = ''' This 'should'
-'not' be
+be
 'linted' '''
 
 s = """ This 'should'
 'not' be
-linted 'either' """
+'linted' """
+
+s = '''"This should not be linted due to having would-be quadruple end 
quote"'''


Reply via email to