Git Product home page Git Product logo

action-mypy's Introduction

action-mypy

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

github-pr-review demo github-pr-check demo

This is a action-mypy repository for reviewdog action with release automation.

Limitation: mypy report multiline error, but now, multiline error cannot be handled in one unit. It handles the error line by line. see Issue.

Notice: This action is composition action.

You accept below one:

  • Your workflow manually setup to run pip install -r requirements.txt or other setup method.
  • This action automatic run pip install mypy.

Input

inputs:
  github_token:
    description: 'GITHUB_TOKEN'
    required: false
    default: '${{ github.token }}'
  workdir:
    description: |
      Working directory of where to run mypy command.
      Relative to the root directory.
    required: false
    default: '.'
  target:
    description: |
      Target file or directory of mypy command.
      Relative to the working directory.
    required: false
    default: '.'
  ### Flags for reviewdog ###
  level:
    description: 'Report level for reviewdog [info,warning,error]'
    required: false
    default: 'error'
  reporter:
    description: 'Reporter of reviewdog command [github-pr-check,github-pr-review].'
    required: false
    default: 'github-pr-check'
  filter_mode:
    description: |
      Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
      Default is added.
    required: false
    default: 'added'
  fail_on_error:
    description: |
      Exit code for reviewdog when errors are found [true,false]
      Default is `false`.
    required: false
    default: 'false'
  reviewdog_flags:
    description: 'Additional reviewdog flags'
    required: false
    default: ''
  ### Flags for mypy ###
  mypy_flags:
    description: 'mypy options (default: <none>)'
    required: false
    default: ''
  tool_name:
    description: 'Tool name to use for reviewdog reporter'
    default: 'mypy'

Input note

mypy_flags is used for workflow setting. (eg '--strict --strict-equality').

But when this flag as set, ignore and do not affect setup.cfg or other mypy's settings file parameters.

Use this flag when you want to check a workflow that is different from the project settings.

Usage

name: reviewdog
on: [pull_request]
jobs:
  mypy:
    name: runner / mypy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: tsuyoshicho/action-mypy@v3
        with:
          github_token: ${{ secrets.github_token }}
          # Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
          reporter: github-pr-review
          # Change reporter level if you need.
          # GitHub Status Check won't become failure with warning.
          level: warning
          # Change the current directory to run mypy command.
          # mypy command reads setup.cfg or other settings file in this path.
          workdir: src

Development

Release

You can bump version on merging Pull Requests with specific labels (bump:major,bump:minor,bump:patch). Pushing tag manually by yourself also work.

This action updates major/minor release tags on a tag push. e.g. Update v1 and v1.2 tag when released v1.2.3. ref: https://help.github.com/en/articles/about-actions#versioning-your-action

Lint - reviewdog integration

This reviewdog action mypy itself is integrated with reviewdog to run lints which is useful for Docker container based actions.

reviewdog integration

Dependencies Update Automation

This repository uses haya14busa/action-depup to update reviewdog version.

reviewdog depup demo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.