redhat-beyond / JobSeeker

https://github.com/redhat-beyond/JobSeeker
MIT License
2 stars 5 forks source link

🚀 Add Flake8 CI Github-Action For Python #8

Closed taljacob2 closed 2 years ago

taljacob2 commented 2 years ago

Use the Flake8 tool and set things up so that it scans our code automatically as we send PRs and provides feedback on the PR review screen.

  1. Install Flake8.
  2. Configure Flake8 to set the maximum-line-length to be 120, via the line:
    pipenv run flake8 --max-line-length 120
  3. In Github, setup branch-protection of the main branch, by asserting that every PR to the main branch must be approved by the Flake8 tool.

    NOTE: That means, no one would be able to push changes to the main branch without requesting an official PR.

    Do it like so:

    1. Go to the repository's “settings” and select “branches”, then click the “add rule” button.
    2. Write “main” in the “Branch name pattern” field.
    3. Select “Require status checks to pass before merging”.
    4. In the search field that now appears, write the name of our CI test from the .yml file: “Check code with Flake8”, and select the same name from the dropdown.
    5. Click the “Create” button at the bottom of this page to create the rule.

ATTENTION: This issue DEPENDS ON #7