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
.
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'
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.
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
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
This reviewdog action mypy itself is integrated with reviewdog to run lints which is useful for Docker container based actions.
This repository uses haya14busa/action-depup to update reviewdog version.