mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-06 16:40:39 +00:00
![]() ## Summary This PR implements a diff test helper `assert_diagnostics_diff` as described in #19351. The diff file includes both the settings ( e.g. `+linter.preview = enabled`) and the snapshot data itself. The current implementation looks for each old diagnostic in the new snapshot. This works when the preview behavior adds/removes a couple diagnostics. This implementation does not work well when every diagnostic is modified (e.g. a "fix" is added). https://github.com/astral-sh/ruff/pull/19715#discussion_r2259410763 has ideas for future improvements to this implementation. The example usage in this PR writes the diff to `preview_diff` file instead of `preview` file, which might be a useful convention to keep. ## Test Plan - Included a unit test at: https://github.com/astral-sh/ruff/pull/19715/files#diff-d49487fe3e8a8585529f62c2df2a2b0a4c44267a1f93d1e859dff1d9f8771d36R523 - Example usage of this new test helper: https://github.com/astral-sh/ruff/pull/19715/files#diff-2a33ac11146d1794c01a29549a6041d3af6fb6f9b423a31ade12a88d1951b0c2R1 |
||
---|---|---|
.. | ||
ruff | ||
ruff_annotate_snippets | ||
ruff_benchmark | ||
ruff_cache | ||
ruff_db | ||
ruff_dev | ||
ruff_diagnostics | ||
ruff_formatter | ||
ruff_graph | ||
ruff_index | ||
ruff_linter | ||
ruff_macros | ||
ruff_memory_usage | ||
ruff_notebook | ||
ruff_options_metadata | ||
ruff_python_ast | ||
ruff_python_ast_integration_tests | ||
ruff_python_codegen | ||
ruff_python_formatter | ||
ruff_python_index | ||
ruff_python_literal | ||
ruff_python_parser | ||
ruff_python_semantic | ||
ruff_python_stdlib | ||
ruff_python_trivia | ||
ruff_python_trivia_integration_tests | ||
ruff_server | ||
ruff_source_file | ||
ruff_text_size | ||
ruff_wasm | ||
ruff_workspace | ||
ty | ||
ty_combine | ||
ty_ide | ||
ty_project | ||
ty_python_semantic | ||
ty_server | ||
ty_static | ||
ty_test | ||
ty_vendored | ||
ty_wasm |