Open LeskoIam opened 4 months ago
Hi, @LeskoIam, thanks for reporting this. Are you able to reproduce this problem when running docstr-coverage manually (outside of pre-commit hooks)?
Hi @HunterMcGushion and thanks for looking into this!
I can reproduce this by manually running the hook, e.g.:
(.venv) ~\workspace\...\ git:[LeskoIam/reproduce-docstr-coverage-issue]
pre-commit run identity
identity.................................................................Passed
- hook id: identity
- duration: 0.06s
.pre-commit-config.yaml
src/my_tests/smth2.py
(.venv) ~\workspace\...\ git:[LeskoIam/reproduce-docstr-coverage-issue]
pre-commit run docstr-coverage
docstr-coverage..........................................................Failed
- hook id: docstr-coverage
- duration: 0.25s
- exit code: 1
No Python files found. Use `--accept-empty` to exit with code 0 if you expect this case, or specify the paths you'd like to check via command line arguments or the config file.
A few details
docstr-coverage==2.3.2
pre-commit==3.7.1
# .pre-commit-config.yaml
repos:
- repo: meta
hooks:
- id: identity
- repo: https://github.com/HunterMcGushion/docstr_coverage
rev: v2.3.2
hooks:
- id: docstr-coverage
args: ["--verbose", "3", "--percentage-only"]
verbose: true
stages: [commit]
Hey! I forked the repo and added test for single .py file in directory which is passing without a problem.
So I think the problem is with pre-commit package. I'll try to add specific tests for pre-commit hooks.
When using docstr-coverage with pre-commit and using
stages: [commit]
e.g.:.docstr.yaml
even though *.py files are present in commit
docstr-coverage passes with warning
Any input on this? Thank you!