ruff/crates
GiGaGon ec07a0f885
[flake8-use-pathlib] Add fix safety section to PTH201 (#18837)
<!--
Thank you for contributing to Ruff/ty! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title? (Please prefix
with `[ty]` for ty pull
  requests.)
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

Part of #15584

This adds a `Fix safety` section to [path-constructor-current-directory
(PTH201)](https://docs.astral.sh/ruff/rules/path-constructor-current-directory/#path-constructor-current-directory-pth201)

I could not track down the original PR as this rule is so old it has
gone through several large ruff refactors.
The unsafety is determined here:

d9266284df/crates/ruff_linter/src/rules/flake8_use_pathlib/rules/path_constructor_current_directory.rs (L55-L59)
Unsafe code example:
[playground](https://play.ruff.rs/76da532a-c7ad-4ef9-bba3-4626296e5317)
```py
from pathlib import Path
Path(#
    "."#
)
```

## Test Plan

<!-- How was it tested? -->

N/A, no tests/functionality affected
2025-06-23 08:22:00 -05:00
..
ruff
ruff_annotate_snippets
ruff_benchmark [ty] Add Tanjun benchmark (#18850) 2025-06-21 18:29:02 +02:00
ruff_cache
ruff_db
ruff_dev
ruff_diagnostics
ruff_formatter
ruff_graph fix casing of analyze.direction variant names (#18892) 2025-06-23 14:30:30 +02:00
ruff_index
ruff_linter [flake8-use-pathlib] Add fix safety section to PTH201 (#18837) 2025-06-23 08:22:00 -05:00
ruff_macros
ruff_notebook
ruff_options_metadata
ruff_python_ast
ruff_python_ast_integration_tests
ruff_python_codegen
ruff_python_formatter [pylint] Supress PLE2510/2512/2513/2514/2515 autofix if the text contains an odd number of backslashes (#18856) 2025-06-23 10:11:51 +02:00
ruff_python_index
ruff_python_literal
ruff_python_parser
ruff_python_resolver
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] Support --python=<symlink to executable> (#18827) 2025-06-21 20:28:47 +01:00
ty_ide
ty_project
ty_python_semantic [ty] Update mypy_primer, add two new projects (#18891) 2025-06-23 13:08:11 +02:00
ty_server
ty_test Remove extra dot in rule documentation (#18871) 2025-06-23 00:33:21 +00:00
ty_vendored
ty_wasm