ruff
cee09765 - Use transformed source code for diagnostic locations (#9408)

Comment changes are shownComment changes are hidden
Commit
1 year ago
Use transformed source code for diagnostic locations (#9408) ## Summary After we apply fixes, the source code might be transformed. And yet, we're using the _unmodified_ source code to compute locations in some cases (e.g., for displaying parse errors, or Jupyter Notebook cells). This can lead to subtle errors in reporting, or even panics. This PR modifies the linter to use the _transformed_ source code for such computations. Closes https://github.com/astral-sh/ruff/issues/9407.
Author
Parents
  • crates
    • ruff_cli
      • src
        • File
          diagnostics.rs
      • tests
        • File
          integration_test.rs
    • ruff_linter/src/rules/pycodestyle/rules
      • File
        missing_newline_at_end_of_file.rs