[PATCH v3 16/19] modula2 front end: bootstrap and documentation tools

Martin Liška mliska@suse.cz
Wed Dec 7 09:26:51 GMT 2022


On 12/6/22 15:47, Gaius Mulley wrote:
> |Hi Martin, here is the revised patch having applied all previous recommendations: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603436.html. Is this ok now? Thanks for the improvement suggestions.|

Hello.

It looks much better and I'm sending a small patch that resolves the remaining
flake8 issue. I use the following plugins (some listed here: https://gcc.gnu.org/codingconventions.html#python):

$ flake8 --version
5.0.4 (flake8-bugbear: 22.10.27, flake8-builtins: 1.5.3, flake8-comprehensions: 3.4.0, flake8-import-order: 0.18.1, flake8-quotes: 3.3.1, mccabe: 0.7.0, pycodestyle: 2.9.1, pyflakes: 2.5.0) CPython 3.10.8 on Linux

and I see:

gcc/m2/tools-src> flake8
./boilerplate.py:108:66: E999 SyntaxError: invalid syntax
./tidydates.py:26:1: I100 Import statements are in the wrong order. 'import pathlib' should be before 'import sys'
./tidydates.py:129:50: E128 continuation line under-indented for visual indent
./def2doc.py:49:5: E301 expected 1 blank line, found 0
./def2doc.py:49:18: E211 whitespace before '('
./def2doc.py:51:5: E301 expected 1 blank line, found 0
./def2doc.py:51:18: E211 whitespace before '('
./def2doc.py:53:5: E301 expected 1 blank line, found 0
./def2doc.py:55:5: E301 expected 1 blank line, found 0
./def2doc.py:57:5: E301 expected 1 blank line, found 0
./def2doc.py:59:5: E301 expected 1 blank line, found 0
./def2doc.py:61:5: E301 expected 1 blank line, found 0
./def2doc.py:65:5: E301 expected 1 blank line, found 0
./def2doc.py:70:5: E301 expected 1 blank line, found 0
./def2doc.py:72:5: E301 expected 1 blank line, found 0
./def2doc.py:191:80: E501 line too long (81 > 79 characters)
./def2doc.py:330:22: A002 argument "dir" is shadowing a python builtin
./def2doc.py:348:23: A002 argument "dir" is shadowing a python builtin
./def2doc.py:377:17: A002 argument "dir" is shadowing a python builtin
./def2doc.py:396:21: A002 argument "dir" is shadowing a python builtin
./def2doc.py:406:16: A002 argument "dir" is shadowing a python builtin
./def2doc.py:418:15: A002 argument "dir" is shadowing a python builtin
./def2doc.py:432:25: A002 argument "dir" is shadowing a python builtin
./def2doc.py:437:19: Q000 Double quotes found but single quotes preferred
./def2doc.py:439:19: Q000 Double quotes found but single quotes preferred
./def2doc.py:441:19: Q000 Double quotes found but single quotes preferred
./def2doc.py:468:18: Q001 Single quote multiline found but double quotes preferred

It seems the first one is a real syntax error. Anyway, feel free to apply the suggested patch.

And I would consider replacing the following static 'str.' calls:

def2doc.py:            output.write(str.replace(str.replace(str.rstrip(line),
def2doc.py:        output.write(str.replace(str.replace(line, '{', '@{'), '}', '@}'))

with line.rstrip().replace(...).replace(...)

Cheers,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: m2-flake8.patch
Type: text/x-patch
Size: 12248 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20221207/ba693b52/attachment-0001.bin>


More information about the Gcc-patches mailing list