Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code_format: allow skipping build fixer #37811

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tools/code_format/check_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def excluded_prefixes(self):
def error_messages(self):
return []

@property
def run_build_fixer(self):
return not self.args.skip_build_fixer

@property
def operation_type(self):
return self.args.operation_type
Expand Down Expand Up @@ -207,6 +211,8 @@ def args(self):
nargs="+",
default=[],
help="exclude paths from the namespace_check.")
parser.add_argument(
"--skip_build_fixer", action="store_true", help="skip running build fixer script")
parser.add_argument(
"--build_fixer_check_excluded_paths",
type=str,
Expand Down Expand Up @@ -1108,8 +1114,9 @@ def included_for_memcpy(self, file_path):

def _run_build_fixer(self, filepath: str) -> bool:
return (
not self.is_build_fixer_excluded_file(filepath) and not self.is_api_file(filepath)
and not self.is_starlark_file(filepath) and not self.is_workspace_file(filepath))
self.run_build_fixer and not self.is_build_fixer_excluded_file(filepath)
and not self.is_api_file(filepath) and not self.is_starlark_file(filepath)
and not self.is_workspace_file(filepath))


def main(*args):
Expand Down