From efc49e4dfaeeda3c0ee3d2eca90bb532dc7f7610 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Fri, 9 Jun 2023 02:41:34 -0400 Subject: Add support for tidy linting via external tools for non-rust files This change adds the flag `--check-extras` to `tidy`. It accepts a comma separated list of any of the options: - py (test everything applicable for python files) - py:lint (lint python files using `ruff`) - py:fmt (check formatting for python files using `black`) - shell or shell:lint (lint shell files using `shellcheck`) Specific files to check can also be specified via positional args. Examples: - `./x test tidy --check-extras=shell,py` - `./x test tidy --check-extras=py:fmt -- src/bootstrap/bootstrap.py` - `./x test tidy --check-extras=shell -- src/ci/*.sh` - Python formatting can be applied with bless: `./x test tidy --ckeck-extras=py:fmt --bless` `ruff` and `black` need to be installed via pip; this tool manages these within a virtual environment at `build/venv`. `shellcheck` needs to be installed on the system already. --- src/bootstrap/builder/tests.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/bootstrap/builder') diff --git a/src/bootstrap/builder/tests.rs b/src/bootstrap/builder/tests.rs index 65b8f7fd3b7..06ed00ee06e 100644 --- a/src/bootstrap/builder/tests.rs +++ b/src/bootstrap/builder/tests.rs @@ -587,6 +587,7 @@ mod dist { run: None, only_modified: false, skip: vec![], + extra_checks: None, }; let build = Build::new(config); @@ -658,6 +659,7 @@ mod dist { pass: None, run: None, only_modified: false, + extra_checks: None, }; // Make sure rustfmt binary not being found isn't an error. config.channel = "beta".to_string(); -- cgit 1.4.1-3-g733a5