From 9e3c7529a42a34fc26a8c8ae7cb8f0650af26cc6 Mon Sep 17 00:00:00 2001 From: GiGaGon <107241144+MeGaGiGaGon@users.noreply.github.com> Date: Mon, 23 Dec 2024 17:44:17 -0800 Subject: [PATCH 1/4] Update __init__.py --- src/black/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/black/__init__.py b/src/black/__init__.py index 5f699452646..484cc591509 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -748,6 +748,8 @@ def get_sources( for s in src: if s == "-" and stdin_filename: + if path_is_excluded(stdin_filename, force_exclude): + continue path = Path(stdin_filename) is_stdin = True else: From c4adfcb578e95aa1a6d0e90346ade7ab92769a52 Mon Sep 17 00:00:00 2001 From: GiGaGon <107241144+MeGaGiGaGon@users.noreply.github.com> Date: Mon, 23 Dec 2024 17:47:23 -0800 Subject: [PATCH 2/4] Update CHANGES.md --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index c1e6320740d..bfe75a376ae 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -53,6 +53,9 @@ +- If using stdin with `--stdin-filename` set to a force excluded path, stdin won't be + formatted. (#4539) + ### Documentation