Fix integration between stdin filename and --force-exclude (#4539)
This commit is contained in:
parent
3b00112ac5
commit
9431e98522
@ -56,6 +56,9 @@
|
||||
|
||||
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
|
||||
|
||||
- If using stdin with `--stdin-filename` set to a force excluded path, stdin won't be
|
||||
formatted. (#4539)
|
||||
|
||||
### Documentation
|
||||
|
||||
<!-- Major changes to documentation and policies. Small docs changes
|
||||
|
@ -749,6 +749,12 @@ def get_sources(
|
||||
for s in src:
|
||||
if s == "-" and stdin_filename:
|
||||
path = Path(stdin_filename)
|
||||
if path_is_excluded(stdin_filename, force_exclude):
|
||||
report.path_ignored(
|
||||
path,
|
||||
"--stdin-filename matches the --force-exclude regular expression",
|
||||
)
|
||||
continue
|
||||
is_stdin = True
|
||||
else:
|
||||
path = Path(s)
|
||||
|
Loading…
Reference in New Issue
Block a user