Skip to content

Conversation

@ntBre
Copy link
Contributor

@ntBre ntBre commented Jul 10, 2025

Summary

I spun this off from #19133 to be sure to get an accurate baseline before modifying any of the formats. I picked the code snippet to include a lint diagnostic with a fix, one without a fix, and one syntax error. I'm happy to expand it if there are any other kinds we want to test.

I initially passed CONTENT on stdin, but I was a bit surprised to notice that some of our output formats include an absolute path to the file. I switched to a TempDir to use the tempdir_filter.

Test Plan

New CLI tests

Summary
--

I spun this off from #19133 to be sure to get an accurate baseline before
modifying any of the formats. I picked the code snippet to include a lint
diagnostic with a fix, one without a fix, and one syntax error. I'm happy to
expand it if there are any other kinds we want to test.

Test Plan
--

New CLI tests
@ntBre ntBre added testing Related to testing Ruff itself internal An internal refactor or improvement labels Jul 10, 2025
@ntBre ntBre marked this pull request as ready for review July 10, 2025 17:11
@ntBre ntBre requested a review from MichaReiser July 10, 2025 17:12
@github-actions
Copy link
Contributor

github-actions bot commented Jul 10, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre
Copy link
Contributor Author

ntBre commented Jul 10, 2025

After a lot of trial and error, and spinning up a Windows VPS, I finally just used a regex for the paths. Some of the structured output formats are escaped or double escaped or even use forward slashes on Windows, so tempdir_filter wasn't sufficient. Happy to revisit this if you have a better idea, but I think this works well enough.

@ntBre ntBre merged commit 08bc6d2 into main Jul 10, 2025
35 checks passed
@ntBre ntBre deleted the brent/output-format-tests branch July 10, 2025 21:57
UnboundVariable pushed a commit to UnboundVariable/ruff that referenced this pull request Jul 11, 2025
…re_help

* 'main' of https://github.com/astral-sh/ruff:
  Add simple integration tests for all output formats (astral-sh#19265)
  [`flake8-return`] Fix false-positive for variables used inside nested functions in `RET504`  (astral-sh#18433)
  [ty] Add a `--quiet` mode (astral-sh#19233)
  Treat form feed as valid whitespace before a line continuation (astral-sh#19220)
  [ty] Make `check_file` a salsa query (astral-sh#19255)
  [ty] Consolidate submodule resolving code between `types.rs` and `ide_support.rs` (astral-sh#19256)
  [ty] Remove countme from salsa-structs (astral-sh#19257)
  [ty] Improve and document equivalence for module-literal types (astral-sh#19243)
  [ty] Optimize protocol subtyping by removing expensive and unnecessary equivalence check from the top of `Type::has_relation_to()` (astral-sh#19230)
  [ty] Ecosystem analyzer: parallelize, fix race condition (astral-sh#19252)
  [ty] Add completion kind to playground (astral-sh#19251)
  [ty] Deploy ecosystem diff to Cloudflare pages (astral-sh#19234)
  [ty] Add semantic token provider to playground (astral-sh#19232)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement testing Related to testing Ruff itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants