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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
[flake8]
ignore = E501,E126,E127,E128,E722
exclude = bin,docs,include,lib,lib64,.git
filename =
*.py,
*.py.in,
# same limit as black
max-line-length = 88
ignore =
# E203 whitespace before ':'
# result of black-formatted code
E203,
# W503: line break before binary operator
W503
per-file-ignores =
# some lines are longer than 88
src/insights_client/__init__.py: E501
integration-tests/test_unregister.py: E501
extend-exclude =
# default build directory
build/,
10 changes: 9 additions & 1 deletion .github/workflows/stylish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
stylish:
name: "black"
name: "black & flake8"
runs-on: ubuntu-latest
container:
image: fedora:latest
Expand All @@ -16,10 +16,18 @@ jobs:
run: |
dnf --setopt install_weak_deps=False install -y \
git-core \
python3-flake8 \
python3-pip

- uses: actions/checkout@v4

- uses: psf/black@stable
with:
version: "24.2.0"

- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1

- name: Run flake8
run: |
flake8
1 change: 0 additions & 1 deletion integration-tests/test_registration.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import subprocess

import pytest

Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# the version of black is specified also in the stylish.yml github workflow;
# please update the version there in case it is bumped here
black==24.2.0
flake8
6 changes: 2 additions & 4 deletions src/insights_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,13 @@ def run_phase(phase, client, validated_eggs):
stdout, stderr = process.communicate()
if process.returncode == 0:
# phase successful, don't try another egg
client_debug(
"phase '{phase}' successful".format(egg=egg, phase=phase["name"])
)
client_debug("phase '{phase}' successful".format(phase=phase["name"]))
update_motd_message()
return

client_debug(
"phase '{phase}' failed with return code {rc}".format(
egg=egg, phase=phase["name"], rc=process.returncode
phase=phase["name"], rc=process.returncode
)
)
if process.returncode == 1:
Expand Down
Loading