Run CI's Sanity Check step arguments: interactive -- start a shell after running build / test scripts fix -- where possible (currently black and clang-format) edit files in place with formatting fixes docker-image -- manually specify the docker image to use
(interactive: bool = False, fix: bool = False, docker_image: str | None = None)
| 334 | |
| 335 | |
| 336 | def lint(interactive: bool = False, fix: bool = False, docker_image: str | None = None) -> None: |
| 337 | """ |
| 338 | Run CI's Sanity Check step |
| 339 | |
| 340 | arguments: |
| 341 | interactive -- start a shell after running build / test scripts |
| 342 | fix -- where possible (currently black and clang-format) edit files in place with formatting fixes |
| 343 | docker-image -- manually specify the docker image to use |
| 344 | """ |
| 345 | env = {} |
| 346 | if fix: |
| 347 | env["IS_LOCAL"] = "true" |
| 348 | env["INPLACE_FORMAT"] = "true" |
| 349 | |
| 350 | docker( |
| 351 | name=gen_name("ci-lint"), |
| 352 | image="ci_lint" if docker_image is None else docker_image, |
| 353 | scripts=["pre-commit run --all-files"], |
| 354 | env=env, |
| 355 | interactive=interactive, |
| 356 | ) |
| 357 | |
| 358 | |
| 359 | Option = tuple[str, list[str]] |