Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check

GitHub Action

Run flake8 with reviewdog

v3.2.0

Run flake8 with reviewdog

check

Run flake8 with reviewdog

🐶 Run flake8 with reviewdog on pull requests to improve code review experience

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Run flake8 with reviewdog

uses: reviewdog/[email protected]

Learn more about this action in reviewdog/action-flake8

Choose a version

Reviewdog/action-flake8 composite GitHub Action

Test reviewdog depup release GitHub release (latest SemVer) action-bumpr supported

github-pr-review example picture github-check example picture

This composite action runs flake8 with reviewdog on pull requests to lint to lint python source files while creating annotations. It does this by installing the Python flake8 package in an environment with a Python interpreter and executes flake8 stylistic and logical linting of Python source files. Following reviewdog is used to parse the bash output into GitHub annotations. This (composite) action is meant to be run inside an existing workflow and therefore, does not install python or set up a python environment.

Quick Start

In it's simplest form this action can be used to annotate the changes that are suggested by the flake8 linter.

name: flake8 Lint

on: [push, pull_request]

jobs:
  flake8-lint:
    runs-on: ubuntu-latest
    name: Lint
    steps:
      - name: Check out source repository
        uses: actions/checkout@v2
      - name: Set up Python environment
        uses: actions/setup-python@v2
        with:
          python-version: "3.8"
      - name: flake8 Lint
        uses: reviewdog/action-flake8@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

See the Inputs section below for details on the defaults and optional configuration settings.

Inputs

github_token

Required. The GITHUB_TOKEN. Must be in form of github_token: ${{ secrets.github_token }}. Defaults to ${{ github.token }}.

workdir

Optional. The directory to run flake8 in. Defaults to ..

flake8_args

Optional. Command-line arguments to the flake8 executable. Defaults to "".

Please note that some command-line arguments can be defined with other fields in your configuration. You may combine the args setting with the other settings below, or use args to configure flake8 without the other Action settings.

level

Optional. The log level of the reviewdog reporter. Options: [info, warning, error]. Defaults to error.

reporter

Optional. Reporter of reviewdog command [github-pr-check, github-pr-review, github-check]. Defaults to github-pr-check.

filter_mode

Optional. Filtering mode for the reviewdog command [added, diff_context, file, nofilter]. Defaults to added.

fail_on_error

Optional. Exit code for reviewdog when errors are found [true, false]. Defaults to false.

reviewdog_flags

Optional. Additional reviewdog flags. Defaults to "".

tool_name

Optional. Tool name to use for reviewdog reporter. Defaults to flake8.