Giter Club home page Giter Club logo

Comments (10)

tsuyoshicho avatar tsuyoshicho commented on July 19, 2024 1

I'm late, I'll check it out

from action-mypy.

tsuyoshicho avatar tsuyoshicho commented on July 19, 2024 1

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.

tsuyoshicho avatar tsuyoshicho commented on July 19, 2024

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.

tsuyoshicho avatar tsuyoshicho commented on July 19, 2024

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.

rtizzy avatar rtizzy commented on July 19, 2024

@tsuyoshicho

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.

rtizzy avatar rtizzy commented on July 19, 2024

Note that it also seems to work with filter_mode: file.

from action-mypy.

rtizzy avatar rtizzy commented on July 19, 2024

Although with either filter_mode: file or filter_mode: nofilter both seem to output using the check API and not a comment :(

image

from action-mypy.

tsuyoshicho avatar tsuyoshicho commented on July 19, 2024

@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.

rtizzy avatar rtizzy commented on July 19, 2024

@tsuyoshicho

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

  1. You have a branch with change
  2. You open a PR.
  3. Any changes to code in that PR will be filtered out and shown in the PR Review after tests run
  4. You continue to make changes to the branch with an open PR
  5. 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.

rtizzy avatar rtizzy commented on July 19, 2024

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)

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.