mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-17 23:59:58 +00:00
![]() ## Summary This PR attempts to draw a clearer divide between "methods that take (e.g.) an expression or statement as input" and "methods that rely on the _current_ expression or statement" in the semantic model, by renaming methods like `stmt()` to `current_statement()`. This had led to confusion in the past. For example, prior to this PR, we had `scope()` (which returns the current scope), and `parent_scope`, which returns the parent _of a scope that's passed in_. Now, the API is clearer: `current_scope` returns the current scope, and `parent_scope` takes a scope as argument and returns its parent. Per above, I also changed `stmt` to `statement` and `expr` to `expression`. |
||
---|---|---|
.. | ||
flake8_to_ruff | ||
ruff | ||
ruff_benchmark | ||
ruff_cache | ||
ruff_cli | ||
ruff_dev | ||
ruff_diagnostics | ||
ruff_formatter | ||
ruff_index | ||
ruff_macros | ||
ruff_python_ast | ||
ruff_python_codegen | ||
ruff_python_formatter | ||
ruff_python_index | ||
ruff_python_literal | ||
ruff_python_parser | ||
ruff_python_resolver | ||
ruff_python_semantic | ||
ruff_python_stdlib | ||
ruff_python_trivia | ||
ruff_shrinking | ||
ruff_source_file | ||
ruff_text_size | ||
ruff_wasm |