From 2070dc96335a4c8220ee308e2ca67fa392a4ab53 Mon Sep 17 00:00:00 2001 From: Jackson Oursland Date: Sun, 4 May 2025 14:56:42 -0700 Subject: [PATCH] CI: add missing command line args to codespell.py. (#21127) * CI: add missing command line args to codespell.py. * CI: alter files parameters to codespell.py. * CI: update verbose flag in codespell to be boolean. --- .github/workflows/sub_lint.yml | 2 +- tools/lint/codespell.py | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sub_lint.yml b/.github/workflows/sub_lint.yml index f880adc5f3..913f8b50fa 100644 --- a/.github/workflows/sub_lint.yml +++ b/.github/workflows/sub_lint.yml @@ -305,7 +305,7 @@ jobs: continue-on-error: ${{ inputs.codespellFailSilent }} run: | python3 tools/lint/codespell.py \ - --files "${{ inputs.changedFiles }}" \ + --files ${{ inputs.changedFiles }} \ --ignore-words "${{ inputs.listIgnoredMisspelling }}" \ --skip "${{ inputs.spellingIgnore }}" \ --log-dir "${{ env.logdir }}" \ diff --git a/tools/lint/codespell.py b/tools/lint/codespell.py index 7c5c9eb9b6..15d833f7ab 100644 --- a/tools/lint/codespell.py +++ b/tools/lint/codespell.py @@ -54,14 +54,36 @@ def main(): parser = argparse.ArgumentParser( description="Run codespell on files and append a Markdown report." ) + parser.add_argument( + "--files", + action="extend", + nargs="+", + required=True, + help="List of files to spell check." + ) parser.add_argument( "--ignore-words", required=True, help="Comma-separated list of words to ignore (from codespellignore).", ) + parser.add_argument( + "--log-dir", + required=True, + help="Directory to store the log file." + ) + parser.add_argument( + "--report-file", + required=True, + help="Name of the report file." + ) parser.add_argument( "--skip", required=True, help="Comma-separated list of file patterns to skip." ) + parser.add_argument( + "--verbose", + action='store_true', + help="Use verbose output." + ) args = parser.parse_args() init_environment(args) @@ -85,7 +107,7 @@ def main(): args.skip, "-D", dictionary_file, - ] + args.files.split() + ] + args.files stdout, stderr, _ = run_command(cmd) output = stdout + "\n" + stderr + "\n"