Commit graph

8 commits

Author SHA1 Message Date
Tomáš Hozza
689ca5cfe5 Lint/pylint: disable too-many-positional-arguments check
The new version of Pylint reports this issue in too many places. It is
unlikely that we would change all occurrences of it just to make
Pylint happy. Disable the check.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-11-25 10:09:18 +01:00
Simon de Vlieger
d60690ce46 tox: add tox
`tox` is a standard testing tool for Python projects, this allows you to
test locally with all your installed Python version with the following
command:

`tox -m test -p all`

To run the tests in parallel for all supported Python versions.

To run linters or type analysis:

```
tox -m lint -p all
tox -m type -p all
```

This commit *also* disables the `import-error` warning from `pylint`,
not all Python versions have the system-installed Python libraries
available and they can't be fetched from PyPI.

Some linters have been added and the general order linters run in has
been changed. This allows for quicker test failure when running
`tox -m lint`. As a consequence the `test_pylint` test has been removed
as it's role can now be fulfilled by `tox`.

Other assorted linter fixes due to newer versions:
- use a str.join method (`consider-using-join`)
- fix various (newer) mypy and pylint issues
- comments starting with `#` and no space due to `autopep8`

This also changes our CI to use the new `tox` setup and on top of that
pins the versions of linters used. This might move into separate
requirements.txt files later on to allow for easier updating of those
dependencies.
2023-08-01 15:01:13 +02:00
David Rheinsberg
c50f14974e build: extend pylint suppressions
Two more suppressions for pylint:

 - line-too-long: Avoid complaining about lines longer than 100ch. We
                  do that all the time and this new linter-default makes
                  newer pylints complain all the time.
 - useless-option-value: Newer pylint decided to obsolete old
                         annotations and start complaining that they are
                         obsolete. We can either stop supporting old
                         pylints are disable those warnings on newer
                         pylints. I opted for the latter.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-13 16:21:14 +02:00
Christian Kellner
c384639aed setup.cfg: enable attribute-defined-outside-init
This warning was globally disabled in commit c124ab2, due to dynamic
attributes of the `LoopInfo` class. This false positive is silenced
locally now. Some actual positives have meanwhile made it into the
code base, but have fixed via previous commits so we can now enable
W0201/attribute-defined-outside-init again.
2022-05-06 17:33:23 +02:00
Christian Kellner
bf655b9464 setup: disable new pylint warnings
For now disable some new warnings from pylint:
    - `consider-using-from-import`
    - `consider-using-with`
It probably makes sense to re-enable these in the future but
for now lets keep the code as is.
2021-11-19 00:19:05 +00:00
Christian Kellner
d8a8dc84d6 setup.cfg: increase max-statements to 75
The default is 50, which we hit in a few places already. Let's do
75, equally arbitrary but gives us a bit more wiggle room.
2021-10-30 00:16:03 +01:00
Christian Kellner
89f372fa3c setup.cfg: set max line length in pycodestyle
Move the max-line-length setting to the `pycodestyle` section,
which is read by pylint but also other tools like autopep8.
2021-05-12 14:26:16 +02:00
Christian Kellner
6567b8f932 setup.cfg; move pylint settings here
Create a setup.cfg file and move the pylint settings from .pylintrc
here. This file can be used to configure other tooling as well, so
it is in general more useful as a central configuration place.
2021-05-12 14:26:16 +02:00
Renamed from .pylintrc (Browse further)