Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the sources with flake8 #196

Merged
merged 5 commits into from
Mar 13, 2024
Merged

Conversation

ptoscano
Copy link
Contributor

@ptoscano ptoscano commented Mar 13, 2024

  • remove extra/unused arguments in format() (fixes F522)
  • remove an unused import (fixes F401)
  • fix/improve the existing .flake8 file according to the current sources
  • run flake8 in the existing stylish GHA workflow

See the messages of the commits for longer descriptions.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Fix & improve a bit the configuration for flake8, so it can be run
without issues:
- drop all the old ignores, no more needed (all the issues where fixed)
- drop the excludes for paths that are either do not exist anymore, or
  that it is not a problem to scan (e.g. "docs")
- add the explicit filename patterns so "*.py.in" files are scanned too;
  adding ".py" is needed since "filename" replaces the default paths
- set the same line length as used by black
- add a couple of known ignores related to the style formatted by black
- ignore longer lines in a couple of files; they are there already, and
  fixing them can be done gradually
- exclude also the default meson build directory

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
In addition to the format with black, check the sources also using
flake8. The job will install flake8 as available in the latest stable
Fedora version.

Use a marketplace action to annotate the files with the result of the
flake8 run.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
Copy link
Contributor

@m-horky m-horky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: rbialon/flake8-annotations@v1.

The latest version is 1.1, I guess we can't do anything there.

@m-horky m-horky merged commit 7a640d5 into RedHatInsights:master Mar 13, 2024
21 checks passed
@ptoscano ptoscano deleted the flake8 branch March 13, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants