ruff/crates
Charlie Marsh 7275c16d98
Extend revised RET504 implementation to with statements (#4998)
## Summary

This PR extends the new `RET504` implementation to handle cases like:

```py
def foo():
    with open("foo.txt", "r") as f:
        x = f.read()
    return x
```

This was originally suggested in
https://github.com/astral-sh/ruff/issues/2950#issuecomment-1433441503.
2023-06-10 04:15:35 +00:00
..
flake8_to_ruff Update links to point to Astral org (#4949) 2023-06-08 11:43:40 -04:00
ruff Extend revised RET504 implementation to with statements (#4998) 2023-06-10 04:15:35 +00:00
ruff_benchmark Add Formatter benchmark (#4860) 2023-06-05 21:05:42 +02:00
ruff_cache Rename ruff_python_semantic's Context struct to SemanticModel (#4565) 2023-05-22 02:35:03 +00:00
ruff_cli Update links to point to Astral org (#4949) 2023-06-08 11:43:40 -04:00
ruff_dev Add a ruff_textwrap crate (#4731) 2023-05-31 16:35:23 +00:00
ruff_diagnostics Use a separate fix-isolation group for every parent node (#4774) 2023-06-02 03:07:55 +00:00
ruff_formatter Rename ruff_formatter::builders::BestFitting to FormatBestFitting (#4841) 2023-06-04 00:13:51 +02:00
ruff_index Introduce ruff_index crate (#4597) 2023-05-23 17:40:35 +02:00
ruff_macros Update links to point to Astral org (#4949) 2023-06-08 11:43:40 -04:00
ruff_python_ast Refactor RET504 to only enforce assignment-then-return pattern (#4997) 2023-06-10 00:05:01 -04:00
ruff_python_formatter Introduce PythonWhitespace to confine trim operations to Python whitespace (#4994) 2023-06-09 21:44:50 -04:00
ruff_python_semantic Rename some methods on SemanticModel (#4990) 2023-06-09 19:36:59 +00:00
ruff_python_stdlib Lint pyproject.toml (#4496) 2023-05-25 12:05:28 +00:00
ruff_python_whitespace Introduce PythonWhitespace to confine trim operations to Python whitespace (#4994) 2023-06-09 21:44:50 -04:00
ruff_rustpython Re-integrate RustPython parser repository (#4359) 2023-05-11 07:47:17 +00:00
ruff_testing_macros testing_macros: Add missing full feature to syn dependency (#4722) 2023-05-30 07:42:06 +00:00
ruff_textwrap Use Python whitespace utilities in ruff_textwrap (#4996) 2023-06-10 02:32:42 +00:00
ruff_wasm Add pyflakes.extend-generics setting (#4677) 2023-06-01 22:19:37 +00:00