google / google/yapf

yapf is failing `pre-commit` with `tool.yapfignore` configured: `yapf: input filenames did not match any python files`

Open
#1,201 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

I have the following `pyproject.toml` configuration for `yapfignore`:

```toml
[tool.yapfignore]
ignore_patterns = [
"configs/**/*.py",
]
```

My `configs/` directory structure:
```
configs/
├── _base_/
│ ├── datasets/
│ └── schedules/
├── detr/
├── mm_grounding_dino/
│ └── cityscapes/
└── rtmdet/
```

I have diffs to a file `configs/_base_/default_runtime.py` that, when I attempt to commit, gets failed on yapf:

```
yapf.....................................................................Failed
- hook id: yapf
- exit code: 1

yapf: input filenames did not match any python files
```

I've tried the following `ignore_patterns`:

- `"configs/**/*.py"`
- `"configs/**"`
- `"configs/*.py"`

Can someone please advise?

Related:
- https://github.com/google/yapf/issues/984

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.