3

I have a codebase that is not in compliance with flake8. The CI/CD pipeline uses GitHub/GitHub actions. I would like to start adding python flake8 (to check for complexity, errors and code smells) progressively. How can I accomplish this task?

1 Answer 1

0

This should get you started: https://github.com/py-actions/flake8

Or if you prefer to do it more manually you can use this:

name: Python

on:
  push:
    branches: [main]
  pull_request:

jobs:
  flake8:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Set up Python
        uses: actions/setup-python@v4.1.0
        with:
          python-version: 3

      - name: Install flake8
        run: pip --disable-pip-version-check install flake8

      - name: Lint with flake8
        run: flake8 --count

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.