SERVER-92234 Explicitly exempt formatting anything in build output dirs (#24481)

GitOrigin-RevId: 2c817e7cc42d1d8500c0e3ec147bf6ca00cd76e1
This commit is contained in:
Zack Winter
2024-07-09 12:32:16 -07:00
committed by MongoDB Bot
parent 836d7814f7
commit e0b7fe8dff
2 changed files with 9 additions and 1 deletions

View File

@@ -30,3 +30,7 @@ version_expansions.yml
# Ignore all formatting in third_party/*
src/third_party
# Ignore anything in the build output directories
build
bazel-*

View File

@@ -5,8 +5,12 @@ import subprocess
def run_prettier(prettier: pathlib.Path, check: bool) -> int:
# Explicitly ignore anything in the output directories to prevent bad symlinks from failing the run,
# see https://github.com/prettier/prettier/issues/11568 as to why it the paths being present in
# .prettierignore isn't sufficient
force_exclude_dirs = ["!./build", "!./bazel-bin", "!./bazel-out", "!./bazel-mongo"]
try:
command = [prettier, "."]
command = [prettier, "."] + force_exclude_dirs
if check:
command.append("--check")
else: