MCPcopy Create free account
hub / github.com/FastLED/FastLED / parse_args

Function parse_args

ci/tools/gh/limit_agent_pr_workflows.py:143–175  ·  view source on GitHub ↗
(argv: list[str])

Source from the content-addressed store, hash-verified

141
142
143def parse_args(argv: list[str]) -> argparse.Namespace:
144 parser = argparse.ArgumentParser(
145 description="Limit GitHub Actions pull_request triggers to the agent PR allowlist."
146 )
147 parser.add_argument(
148 "--workflows-dir",
149 type=Path,
150 default=Path(".github/workflows"),
151 help="Directory containing workflow .yml/.yaml files.",
152 )
153 parser.add_argument(
154 "--allow-pr",
155 action="append",
156 default=[],
157 metavar="FILENAME",
158 help="Additional workflow filename allowed to keep pull_request.",
159 )
160 parser.add_argument(
161 "--apply",
162 action="store_true",
163 help="Rewrite workflow files. Without this flag, only print the planned changes.",
164 )
165 parser.add_argument(
166 "--check",
167 action="store_true",
168 help="Return a non-zero exit code if any workflow would change.",
169 )
170 parser.add_argument(
171 "--print-allowlist",
172 action="store_true",
173 help="Print the effective PR allowlist and exit.",
174 )
175 return parser.parse_args(argv)
176
177
178def main(argv: list[str] | None = None) -> int:

Callers 1

mainFunction · 0.70

Calls 1

parse_argsMethod · 0.80

Tested by

no test coverage detected