MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / trim

Function trim

owlbot.py:124–136  ·  view source on GitHub ↗

Fixes the formatting of generated JS files

(files: list[str], hide_output: bool = False)

Source from the content-addressed store, hash-verified

122
123
124def trim(files: list[str], hide_output: bool = False) -> None:
125 """
126 Fixes the formatting of generated JS files
127 """
128 logger.debug("Trim generated files")
129 for file in files:
130 logger.debug(f"Updating {file}")
131 for expr in _TRIM_EXPRESSIONS:
132 shell.run(
133 ["sed", "-i", "-e", expr, f"{file}"],
134 check=True,
135 hide_output=hide_output,
136 )
137
138
139def fix_hermetic(targets: str = ".", hide_output: bool = False) -> None:

Callers 1

owlbot.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected