Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-I doesn't work with pre-commit #100

Open
lorenzomammana opened this issue Jan 11, 2022 · 1 comment
Open

-I doesn't work with pre-commit #100

lorenzomammana opened this issue Jan 11, 2022 · 1 comment
Assignees
Labels
bug Something isn't working needs triage Issue needs triaging

Comments

@lorenzomammana
Copy link

lorenzomammana commented Jan 11, 2022

Environment

  • interrogate, version 1.5.0
  • OS: Windows 10
  • Python version: 3.8.10

Description of the bug

I'm trying to use interrogate through pre-commit with this hook

  - repo: https://github.com/econchick/interrogate
    rev: 1.5.0
    hooks:
      - id: interrogate
        language: python
        types: [python]
        args:
          [
            "-vv",
            "-i",
            "-I",
            "-M",
            "--fail-under=60",
         ]

If I run pre-commit run --all-files
I obtain

| TOTAL                                         |   517 |  378 |   139 |  26.9% |
--------------- RESULT: FAILED (minimum: 60.0%, actual: 26.9%) ----------------

If instead I run interrogate -vv -i -I -M --fail-under=60 .
I obtain

| TOTAL                                                      |             491 |            364 |             127 |            25.9% | 
------------------------------------------- RESULT: FAILED (minimum: 60.0%, actual: 25.9%) ------------------------------------------- 

That is because in the first case __init__.py are not ignored, while in the second case they are correctly ignored as by -I documentation.

I've done the test also on -M and -i but these two parameter works properly resulting in the same output on both executions.

What you expected to happen

Output of both run should be exactly the same

How to reproduce (as minimally and precisely as possible)

Run interrogate with -I parameter using pre-commit and using cli on an __init__.py file that lacks documentation, the one from cli should pass, the one from interrogate should wrongly fail.

Anthing else we need to know?

I guess it's pretty much the same problem of #60 but here there's no workaround!

@lorenzomammana lorenzomammana added bug Something isn't working needs triage Issue needs triaging labels Jan 11, 2022
@jimrybarski
Copy link
Contributor

Add pass_filenames: false to your hook. See: #60 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Issue needs triaging
Projects
None yet
Development

No branches or pull requests

3 participants