Skip to content

lint: write the report to --out and document every format - #171

Open
abu-tahir-0 wants to merge 1 commit into
patsypppe:mainfrom
abu-tahir-0:feat/lint-html-out
Open

abu-tahir-0 wants to merge 1 commit into
patsypppe:mainfrom
abu-tahir-0:feat/lint-html-out

Conversation

@abu-tahir-0

Copy link
Copy Markdown

Closes #149.

Problem

render_report already knows how to render html (and sarif, junit), but toolgauge lint had no way to put that output in a file: the documented command toolgauge lint --format html --out report.html failed because --out did not exist, and --help claimed only text | json | markdown.

Solution

  • Add --out PATH to lint, mirroring scan: write the rendered report there and print wrote PATH instead of dumping it to stdout.
  • Update the --format help to the six formats the renderer actually supports.

The exit code is unchanged: 1 when a lint rule fails, whether the report went to a file or the terminal.

Testing

  • New CLI test lints the stdio fixture server with --format html --out report.html: asserts the file starts with <!doctype html>, names the failing parameters-are-described rule, the command prints wrote <path>, and exits 1.
  • pytest tests/harness/test_stdio_lint.py -q — 3 passed
  • ruff check, ruff format --check, mypy — clean

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lint: HTML report

1 participant