It is not uncommon to have the same imports
across different python files. Ignore it when
running pylint.
Starting at pylint 2.14.5 this is the default value.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
Older versions of Pylint (<2.1.0) limited the names of various things
to 30 characters. We allowed up to 35 characters for method name due
to pre-existing identifiers.
Modern versions of Pylint no longer have an upper limit. Let's not be
pickier than Pylint's default configuration.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Allow Python scripts in tests/scripts to import modules located in the
scripts directory. To do this, use
```
import scripts_path # pylint: disable=unused-import
```
Declare the scripts directory to pylint and to mypy.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
If we disable or enable a message locally, it's by design. There's no
need to clutter the Pylint output with this information.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
If we take the trouble of using pass, it's because we think the code
is clearer that way. For example, Pylint 2.4 rejects pass in
def foo():
"""Do nothing."""
pass
But relying on a docstring as the sole code is weird, hence the use of
pass.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Pylint warns about things like ``log.info('...'.format(...))``.
It insists on ``log.info('...', ...)``.
This is of minor utility (mainly a performance gain when there are
many messages that use formatting and are below the log level).
Some versions of Pylint (including 1.8, which is the version on
Ubuntu 18.04) only recognize old-style format strings using '%',
and complain about something like ``log.info('{}', foo)`` with
logging-too-many-args (Pylint supports new-style formatting if
declared globally with logging_format_style under [LOGGING] but
this requires Pylint >=2.2).
Disable this warning to remain compatible with Pylint 1.8 and not have
to change abi_check.py to use %-formats instead of {}-formats when
logging.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
The pylint configuration in .pylint was a modified version of the
output of `pylint --generate-rcfile` from an unknown version of
pylint. Replace it with a file that only contains settings that are
modified from the default, with an explanation of why each setting is
modified.
The new .pylintrc was written from scratch, based on the output of
pylint on the current version of the files and on a judgement of what
to silence generically, what to silence on a case-by-case basis and
what to fix.