PyCQA / pydocstyle

docstring style checker
http://pydocstyle.org
MIT License
1.11k stars 188 forks source link

Add support for PEP701 #656

Open parona-source opened 10 months ago

parona-source commented 10 months ago

Closes: https://github.com/PyCQA/pydocstyle/issues/646

parona-source commented 10 months ago

docs/readthedocs.org:pydocstyle

Error

Problem in your project's configuration. No default configuration file found at repository's root.

Doesn't appear to be my fault?

Edit: Yep, config file is required after 10.8.0 (released October 24th).

https://github.com/readthedocs/readthedocs.org/pull/10367 https://github.com/readthedocs/readthedocs.org/issues/10587

parona-source commented 10 months ago
python3.12 -m tokenize <(echo 'f"{f"{f"{f"{f"{f"{1+1}"}"}"}"}"}"')
0,0-0,0:            ENCODING       'utf-8'        
1,0-1,2:            FSTRING_START  'f"'           
1,2-1,3:            OP             '{'            
1,3-1,5:            FSTRING_START  'f"'           
1,5-1,6:            OP             '{'            
1,6-1,8:            FSTRING_START  'f"'           
1,8-1,9:            OP             '{'            
1,9-1,11:           FSTRING_START  'f"'           
1,11-1,12:          OP             '{'            
1,12-1,14:          FSTRING_START  'f"'           
1,14-1,15:          OP             '{'            
1,15-1,17:          FSTRING_START  'f"'           
1,17-1,18:          OP             '{'            
1,18-1,19:          NUMBER         '1'            
1,19-1,20:          OP             '+'            
1,20-1,21:          NUMBER         '1'            
1,21-1,22:          OP             '}'            
1,22-1,23:          FSTRING_END    '"'            
1,23-1,24:          OP             '}'            
1,24-1,25:          FSTRING_END    '"'            
1,25-1,26:          OP             '}'            
1,26-1,27:          FSTRING_END    '"'            
1,27-1,28:          OP             '}'            
1,28-1,29:          FSTRING_END    '"'            
1,29-1,30:          OP             '}'            
1,30-1,31:          FSTRING_END    '"'            
1,31-1,32:          OP             '}'            
1,32-1,33:          FSTRING_END    '"'            
1,33-1,34:          NEWLINE        '\n'           
2,0-2,0:            ENDMARKER      '' 

nested fstrings. didn't take this into account.

parona-source commented 10 months ago
python3.12 -m tokenize <(echo 'f"""Do something. {f"This is a nested fstring."}"""')
0,0-0,0:            ENCODING       'utf-8'        
1,0-1,4:            FSTRING_START  'f"""'         
1,4-1,18:           FSTRING_MIDDLE 'Do something. '
1,18-1,19:          OP             '{'            
1,19-1,21:          FSTRING_START  'f"'           
1,21-1,46:          FSTRING_MIDDLE 'This is a nested fstring.'
1,46-1,47:          FSTRING_END    '"'            
1,47-1,48:          OP             '}'            
1,48-1,51:          FSTRING_END    '"""'          
1,51-1,52:          NEWLINE        '\n'           
2,0-2,0:            ENDMARKER      ''  
python3.11 -m tokenize <(echo 'f"""Do something. {f"This is a nested fstring."}"""')
0,0-0,0:            ENCODING       'utf-8'        
1,0-1,51:           STRING         'f"""Do something. {f"This is a nested fstring."}"""'
1,51-1,52:          NEWLINE        '\n'           
2,0-2,0:            ENDMARKER      ''