From 843749abc3224b53fad1165bff908ddd5e58c44b Mon Sep 17 00:00:00 2001 From: Andrew Bradshaw Date: Thu, 19 Feb 2026 23:57:40 +0000 Subject: [PATCH] SERVER-119997 Dont run prettier on monguard directory GitOrigin-RevId: b5941c8133404e66632c64c9ffe974c32e6e6fcc --- .bazelignore | 3 +++ .gitattributes | 2 +- .prettierignore | 3 +++ bazel/format/rules_lint_format_wrapper.py | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.bazelignore b/.bazelignore index bd80032f359..fd8db055725 100644 --- a/.bazelignore +++ b/.bazelignore @@ -27,3 +27,6 @@ venv .ijwb .git + +# This is not run by bazel at the moment +monguard diff --git a/.gitattributes b/.gitattributes index 9516ca8fd87..81a3aca7bfb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13,5 +13,5 @@ src/mongo/bson/column/bson_column_compressed_data.inl rules-lint-ignored=true *.idl linguist-language=yaml # Do not automatically merge golden test expected output files jstests/**/expected_output/**/* -merge - +monguard/** rules-lint-ignored=true MODULE.bazel.lock rules-lint-ignored=true linguist-generated diff --git a/.prettierignore b/.prettierignore index a4b61f1ec9c..37e153ff957 100644 --- a/.prettierignore +++ b/.prettierignore @@ -60,3 +60,6 @@ bazel-* src/mongo/db/modules/enterprise/src/streams/third_party/mongocxx/dist # asp-js-engine is an external module copied during Docker builds asp-js-engine + +# Ignore monguard directory due to not being part of regular build +monguard diff --git a/bazel/format/rules_lint_format_wrapper.py b/bazel/format/rules_lint_format_wrapper.py index afeba003162..c40acfbecb5 100644 --- a/bazel/format/rules_lint_format_wrapper.py +++ b/bazel/format/rules_lint_format_wrapper.py @@ -103,6 +103,7 @@ def run_prettier( "!./bazel-mongo", "!./external", "!./.compiledb", + "!./monguard", } for path in pathlib.Path(".").iterdir(): if path.is_symlink(): @@ -113,6 +114,9 @@ def run_prettier( "--cache", "--log-level", "warn", + # Changed-files mode may include extensions prettier does not parse (for example .py, .sky). + # Ignore unknown files so formatter routing can continue instead of failing early. + "--ignore-unknown", ] if files_to_format == "all": command += ["."]