buildifier: honor exclude_patterns on Windows too#1399
Open
rdesgroppes wants to merge 1 commit intobazelbuild:mainfrom
Open
buildifier: honor exclude_patterns on Windows too#1399rdesgroppes wants to merge 1 commit intobazelbuild:mainfrom
exclude_patterns on Windows too#1399rdesgroppes wants to merge 1 commit intobazelbuild:mainfrom
Conversation
4bfb583 to
a5af94a
Compare
rdesgroppes
added a commit
to DataDog/datadog-agent
that referenced
this pull request
Oct 14, 2025
### What does this PR do? Applies 2 more patches that were submitted upstream: - bazelbuild/buildtools#1399 - bazelbuild/buildtools#1400 ### Motivation 1. `buildifier` macro: its implementation and Windows runner script template ignore excluded patterns as of today, 2. `buildifier_test` macro: the Windows runner script template doesn't consider the `bazel`-provided manifest file. ### Describe how you validated your changes Local Windows VM (QEMU/virt-manager). ### Additional Notes `bazel run //bazel/buildifier` takes [2 minutes](https://gitlab.ddbuild.io/DataDog/datadog-agent/-/jobs/1177131952#L77-L78) on Windows: 1. they're spawning a nested powershell and then use a "manual" recursion from within, which could be optimized => later effort, 2. as Tony mentioned at multiple occasions, we should only run `buildifier` on modified files => again, later effort.
a5af94a to
fdd0c3f
Compare
fdd0c3f to
d5948f0
Compare
The `exclude_patterns` parameter passed to `buildifier` macros happens to be ignored by the Windows runner script template, which the present change proposes to address. The change tries to adhere to existing choices, by limiting the impact on `factory.bzl` where the `find`-suitable pattern can't be used by the embedded powershell script, and also by respecting the script's coding style.
d5948f0 to
14c4aeb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
exclude_patternsparameter passed tobuildifiermacros happens to be ignored by the Windows runner script template, which the present change proposes to address.The change tries to adhere to existing choices, by limiting the impact on
factory.bzlwhere thefind-suitable pattern can't be used by the embedded powershell script, and also by respecting the script's coding style.