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

GitHub Action

Mypy action

v1.1 Pre-release

Mypy action

check-circle

Mypy action

Run flake8 and annotate the results

Installation

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

              

- name: Mypy action

uses: sasanquaneuf/mypy-github-action@v1.1

Learn more about this action in sasanquaneuf/mypy-github-action

Choose a version

typescript-action status

mypy GitHub Action

This is a GitHub Action to run mypy against your repository. It uses the new GitHub Actions API and JavaScript toolkit. It does fancy things like add annotations to your PRs inline.

(image)

Use it in your project like:

(in .github/workflows/lint.yml)

name: Lint

on:
  push:
    paths:
      - '*.py'

jobs:
  mypy:
    runs-on: ubuntu-latest
    steps:
      - name: Setup Python
        uses: actions/setup-python@v1
        with:
          python-version: 3.7.4
          architecture: x64
      - name: Checkout
        uses: actions/checkout@v1
      - name: Install mypy
        run: pip install mypy
      - name: Run mypy
        uses: sasanquaneuf/mypy-github-action@releases/v1
        with:
          checkName: 'mypy'   # NOTE: this needs to be the same as the job name
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Acknowledgments

This GitHub Action was made with reference to flake8-github-action