lint: Call more checks from test_runner #31653

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2501-lint-commit-range changing 3 files +78 −61
  1. maflcko commented at 1:59 pm on January 14, 2025: member

    The lint commit-script-check.sh can not be called from the test_runner at all and must be called manually. Also, some checks require COMMIT_RANGE to be set.

    Fix all issues by moving two lint checks into the test_runner. Also, the proper commit range is passed to the checks by the test_runner, so that the user no longer has to do it.

  2. lint: Call lint_scripted_diff from test_runner
    Allowing to call the check from the test_runner allows for consistent
    error messages. Also, manually setting the commit range is no longer
    needed.
    faee335285
  3. lint: Call lint_commit_msg from test_runner
    Allowing to call the check from the test_runner allows for consistent
    error messages. Also, manually setting the commit range is no longer
    needed.
    fa42b4aa5e
  4. DrahtBot commented at 1:59 pm on January 14, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31653.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK kevkevinpal

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  5. DrahtBot renamed this:
    lint: Call more checks from test_runner
    lint: Call more checks from test_runner
    on Jan 14, 2025
  6. DrahtBot added the label Tests on Jan 14, 2025
  7. in test/lint/test_runner/src/main.rs:730 in fa42b4aa5e
    723@@ -650,6 +724,10 @@ fn main() -> ExitCode {
    724     };
    725 
    726     let git_root = get_git_root();
    727+    let commit_range = commit_range();
    728+    let commit_log = check_output(git().args(["log", "--no-merges", "--oneline", &commit_range]))
    729+        .expect("git error");
    730+    println!("Checking commit range ({commit_range}):\n{commit_log}\n");
    


    kevkevinpal commented at 11:14 pm on January 20, 2025:

    looks like this adds a new log added to the CI (which I think is fine)

    For other reviewers this is what this log looks like in Cirrus CI

    0[12:23:15.442] Checking commit range (HEAD~..HEAD):
    1[12:23:15.442] fa42b4aa5e lint: Call lint_commit_msg from test_runner
    2[12:23:15.442] faee335285 lint: Call lint_scripted_diff from test_runner
    
  8. in test/lint/test_runner/src/main.rs:729 in fa42b4aa5e
    723@@ -650,6 +724,10 @@ fn main() -> ExitCode {
    724     };
    725 
    726     let git_root = get_git_root();
    727+    let commit_range = commit_range();
    728+    let commit_log = check_output(git().args(["log", "--no-merges", "--oneline", &commit_range]))
    729+        .expect("git error");
    


    kevkevinpal commented at 11:17 pm on January 20, 2025:
    nit: In commit_range there is also a .expect which has the text “git command failed” it would make sense to have the same text for consistency, but feel free to ignore
  9. kevkevinpal approved
  10. kevkevinpal commented at 11:20 pm on January 20, 2025: contributor

    crACK fa42b4a

    I think this is a good change moves some of our python linting scripts into our rust lint runner which reduces the number of python files we need to maintain and does the same thing.

    Looks like this change adds another log which lists the commits being linted and their oneline which I think is fine


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-01-21 03:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me