Re: [PATCH v5 7/7] scripts/ghes_inject: add a script to generate GHES error inject

From: Mauro Carvalho Chehab
Date: Thu Aug 08 2024 - 17:51:59 EST


Em Thu, 8 Aug 2024 16:58:38 -0400
John Snow <jsnow@xxxxxxxxxx> escreveu:

> On Fri, Aug 2, 2024 at 5:44 PM Mauro Carvalho Chehab <
> mchehab+huawei@xxxxxxxxxx> wrote:
>

> > +#!/usr/bin/env python3
> > +#
> > +# pylint: disable=C0301, C0114, R0912, R0913, R0914, R0915, W0511
> >
>
> Out of curiosity, what tools are you using to delint your files

Primarily I use pylint, almost always with disable line(s), as those lint
tools have some warnings that sound too silly (like too many/too low
functions/branches/arguments...). From time to time, I review the disable
lines, to keep the code as clean as desired.

Sometimes I also use pep8 (now named as pycodestyle) and black, specially
when I want some autoformat hints (I manually commit the hunks that make
sense), but I prefer pylint as the primary checking tool. I'm not too
found of the black's coding style, though[1].

[1] For instance, black would do this change:

- g_arm.add_argument("--arm", "--arm-valid",
- help=f"ARM valid bits: {arm_valid_bits}")
+ g_arm.add_argument(
+ "--arm", "--arm-valid", help=f"ARM valid bits: {arm_valid_bits}"
+ )

IMO, the original coding style I wrote is a lot better than black's
suggestion - and it is closer to the C style I use at the Linux Kernel ;-)

> and how are
> you invoking them?

I don't play much with such tools, though. I usually just invoke them with
the python file names(s) without passing any parameters nor creating any
configuration file.

> I don't really maintain any strict regime for python files under
> qemu.git/scripts (yet), so I am mostly curious as to what regimes others
> are using currently. I don't see most QEMU contributors checking in pylint
> ignores etc directly into the files, so it caught my eye.

Having some verification sounds interesting, as it may help preventing
some hidden bugs (like re-defining a variable that it was already used
globally), if such check is not too picky and if stupid warnings can be
bypassed.

Regards,
Mauro