econchick / econchick/interrogate

-I doesn't work with pre-commit

Open
#100 1 comment 0 reactions 1 assignee Claimed by @econchick View on GitHub
bug needs triage
Dominant language
Python
Stars
676
Forks
55
PR merge metrics
No merged PRs in 30d

Description

### 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!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.