Comments (10)
I'm late, I'll check it out
from action-mypy.
Hi, @rtizzy .
I see, there was such a problem.
understood.
In that case, instead of specifying "src" as workdir
(current directory), how about specifying "src" as target
(target files/directories) and running from the top directory (workdir
is ".")?
name: reviewdog
on: [pull_request]
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: tsuyoshicho/action-mypy@v3
with:
github_token: ${{ secrets.github_token }}
# do not define workdir (default .)
# snip
target: src
I'm glad the problem was resolved.
The sample may not be good, so I will try to improve it.
from action-mypy.
hi @borice san,
Although I considered it, it should have been executed: poetry run mypy
.
As a factor that can be considered, the filter mode setting may not match the CI you wanted to check.
By default added
, which only reacts to code added in PRs.
If there is no problem in the added part of the CI, it will not be output.
I would like you to try a different mode or try checking with a PR that has an error in the difference.
see https://github.com/reviewdog/reviewdog#filter-mode
from action-mypy.
Since there is no response, I will close it for now.
If the output is still not correct after creating a difference in PR or changing the detection mode, please create an issue again.
If possible, have a test(reporuduce) repository/PR that you can check.
from action-mypy.
I'm seeing a similar issue executing this via a PR with poetry.
I made a change in the PR that caused things to break (intentionally)
This will output review comments.
- uses: tsuyoshicho/action-mypy@v3
with:
reporter: github-pr-review
level: error
setup_method: nothing
fail_on_error: true
filter_mode: nofilter
workdir: src
execute_command: poetry run mypy
This WILL NOT output review comments (or even output info via CLI) but does fail
- uses: tsuyoshicho/action-mypy@v3
with:
reporter: github-pr-review
level: error
setup_method: nothing
fail_on_error: true
filter_mode: added
workdir: src
execute_command: poetry run mypy
Is that expected behavior?
from action-mypy.
Note that it also seems to work with filter_mode: file
.
from action-mypy.
Although with either filter_mode: file
or filter_mode: nofilter
both seem to output using the check API and not a comment :(
from action-mypy.
@rtizzy
Please see reviewdog option
https://github.com/reviewdog/reviewdog#filter-mode
filter_mode is PR's diff result check method for reviewdog.
Defualt add
is check only added code in PR.
file
is changed files in PR.
nofilter
is all check mode.
Please check the changes in PR.
from action-mypy.
EDIT: See next comment, this may be some unexpected mypy behavior
Yep, I want to confirm that I checked that.
To my understanding here is how pr-review
works with filter_mode: added
- You have a branch with change
- You open a PR.
- Any changes to code in that PR will be filtered out and shown in the PR Review after tests run
- You continue to make changes to the branch with an open PR
- CI/Reviewdog continues to run and updates the PR.
If that is correct then I can say at least in my case, something does not seem to be working properly.
from action-mypy.
For posterity:
At least in my case this was caused by some confusing behavior with how mypy
grabs configs.
From what I can tell, mypy does not move up the directory tree to search for config files.
I configure with a pyproject.toml
(Supported by mypy) stored in the root of the repository with the code held in src/
which currently only enables strict mode.
This worked properly in my case
- uses: tsuyoshicho/action-mypy@v3
with:
reporter: github-pr-review
level: error
setup_method: nothing
fail_on_error: true
filter_mode: added
workdir: src
# Note addition of config file
execute_command: poetry run mypy --config-file ../pyproject.toml
Thanks for the help and for creating this package @tsuyoshicho
from action-mypy.
Related Issues (20)
- Bug: invalidate setting with arguments
- Running mypy with reviewdog has no output HOT 5
- Deps are not installed HOT 5
- Bug: something fails during setup, no error occurs.
- "Running mypy with reviewdog 🐶 ..." does not comment and shows no error, despite errors. HOT 4
- one >53 errrors to report, reviewdog aborts GitHubActionLogWriter: "reported too many annotation" HOT 2
- Action Required: Fix Renovate Configuration
- feat: JSON Output support HOT 1
- Type checking with third party packages HOT 9
- local test need pip install
- Dependency Dashboard
- Multiple reviews generated for multiline mypy error HOT 14
- Allow specifying a mypy version HOT 4
- Some mypy errors are ignored HOT 2
- Custom MyPy binary HOT 4
- TODO: Ignore note refactor HOT 1
- Next major release HOT 1
- Feature request: Multiple targets for mypy HOT 3
- Suggestion: Allow user to choose mypy version manually HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from action-mypy.