Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Old mail has arrived.


devel / comp.lang.python / Re: What to use for finding as many syntax errors as possible.

SubjectAuthor
o Re: What to use for finding as many syntax errors as possible.Cameron Simpson

1
Re: What to use for finding as many syntax errors as possible.

<mailman.589.1665355524.20444.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=24139&group=comp.lang.python#24139

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: cs@cskk.id.au (Cameron Simpson)
Newsgroups: comp.lang.python
Subject: Re: What to use for finding as many syntax errors as possible.
Date: Mon, 10 Oct 2022 09:45:12 +1100
Lines: 30
Message-ID: <mailman.589.1665355524.20444.python-list@python.org>
References: <8ba966ed-a935-84ea-f65d-fec0dc71403a@vub.be>
<Y0NO+FsJ4oeCNO1T@cskk.homeip.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Trace: news.uni-berlin.de BQhMFR2FJChcauUJUYSexgjI6DVY98hLaPrXoVB6oSbg==
Return-Path: <cameron@cskk.id.au>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.011
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '(to': 0.07; 'cards': 0.07;
'tests': 0.07; 'cheers,': 0.11; 'syntax': 0.15; '>>is': 0.16;
'alias': 0.16; 'antoon': 0.16; 'cameron': 0.16; 'from:addr:cs':
0.16; 'from:addr:cskk.id.au': 0.16; 'from:name:cameron simpson':
0.16; 'message-id:@cskk.homeip.net': 0.16; 'pardon': 0.16;
'received:13.237': 0.16; 'received:13.237.201': 0.16;
'received:13.237.201.189': 0.16; 'received:cskk.id.au': 0.16;
'received:id.au': 0.16; 'received:l': 0.16;
'received:mail.cskk.id.au': 0.16; 'simpson': 0.16;
'subject:syntax': 0.16; 'tool?': 0.16; 'wrapper': 0.16; 'wrote:':
0.16; 'python': 0.16; 'bug': 0.19; 'to:addr:python-list': 0.20;
"i've": 0.22; 'ran': 0.22; 'code': 0.23; 'lines': 0.23; 'run':
0.23; 'thorough': 0.26; 'it,': 0.29; 'header:User-Agent:1': 0.30;
"doesn't": 0.32; 'ease': 0.32; 'empty': 0.32; 'subject:for': 0.33;
'there': 0.33; 'header:In-Reply-To:1': 0.34; 'received:au': 0.35;
'runs': 0.35; 'fix': 0.36; 'main': 0.37; 'file': 0.38; 'error,':
0.38; 'serious': 0.40; 'subject:What': 0.40; 'submitting': 0.40;
'something': 0.40; "there's": 0.61; 'once': 0.63; 'received:13':
0.64; 'your': 0.64; 'less': 0.65; 'received:userid': 0.66; 'day':
0.66; 'numbers': 0.67; 'right': 0.68; 'easy': 0.74; 'tools': 0.74;
'skip:y 10': 0.76; 'unit': 0.81; 'cycle.': 0.84; 'phase.': 0.84;
'pipeline': 0.84; 'punch': 0.84; 'subject:many': 0.84; 'waited':
0.84
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <8ba966ed-a935-84ea-f65d-fec0dc71403a@vub.be>
User-Agent: Mutt/2.2.7 (2022-08-07)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <Y0NO+FsJ4oeCNO1T@cskk.homeip.net>
X-Mailman-Original-References: <8ba966ed-a935-84ea-f65d-fec0dc71403a@vub.be>
 by: Cameron Simpson - Sun, 9 Oct 2022 22:45 UTC

On 09Oct2022 21:46, Antoon Pardon <antoon.pardon@vub.be> wrote:
>>Is it that onerous to fix one thing and run it again? It was once when
>>you
>>handed in punch cards and waited a day or on very busy machines.
>
>Yes I find it onerous, especially since I have a pipeline with unit tests
>and other tools that all have to redo their work each time a bug is
>corrected.

It is easy to get the syntax right before submitting to such a pipeline.
I usually run a linter on my code for serious commits, and I've got a
`lint1` alias which basicly runs the short fast flavour of that which
does a syntax check and the very fast less thorough lint phase.

I say this just to ease your write/run-tests cycle.

Regarding your main request, had you considered writing your own wrapper
tool? Something which ran something like:

python -We:invalid -m py_compile your_python_file.py

If there's an error, report it, then make a new file commencing with the
next unindented line after the error, with all preceeding lines
commented out (to keep the line numbers the same). Then run the check
again. Repeat until the file's empty or there are no errors.

This doesn't sound very complex.

Cheers,
Cameron Simpson <cs@cskk.id.au>


devel / comp.lang.python / Re: What to use for finding as many syntax errors as possible.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor