ruff/crates
James Berry f85eb709e2
Visit AugAssign target after value (#5325)
## Summary

When visiting AugAssign in evaluation order, the AugAssign `target`
should be visited after it's `value`. Based on my testing, the pseudo
code for `a += b` is effectively:
```python
tmp = a
a = tmp.__iadd__(b)
```

That is, an ideal traversal order would look something like this:
1. load a
2. b
3. op
4. store a

But, there is only a single AST node which captures `a` in the statement
`a += b`, so it cannot be traversed both before and after the traversal
of `b` and the `op`.

Nonetheless, I think traversing `a` after `b` and the `op` makes the
most sense for a number of reasons:
1. All the other assignment expressions traverse their `value`s before
their `target`s. Having `AugAssign` traverse in the same order would be
more consistent.
2. Within the AST, the `ctx` of the `target` for an `AugAssign` is
`Store` (though technically this is a `Load` and `Store` operation, the
AST only indicates it as a `Store`). Since the the store portion of the
`AugAssign` occurs last, I think it makes sense to traverse the `target`
last as well.

The effect of this is marginal, but it may have an impact on the
behavior of #5271.
2023-06-23 09:54:54 -04:00
..
flake8_to_ruff Bump version to 0.0.275 (#5276) 2023-06-21 21:53:37 -04:00
ruff Fix `collection-literal-concatenation` documentation (#5320) 2023-06-22 18:37:54 -04:00
ruff_benchmark Unify benchmarking and profiling docs (#5145) 2023-06-21 09:39:56 +00:00
ruff_cache Only use a single cache file per Python package (#5117) 2023-06-19 17:46:13 +02:00
ruff_cli Keep track of when files are last seen in the cache (#5214) 2023-06-23 15:40:35 +02:00
ruff_dev More stability checker options (#5299) 2023-06-22 15:48:11 +00:00
ruff_diagnostics Use consistent `Cargo.toml` metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_formatter Use trait for labels instead of `TypeId` (#5270) 2023-06-21 22:26:09 +01:00
ruff_index Run `rustfmt` on nightly to clean up erroneous comments (#5106) 2023-06-15 00:19:05 +00:00
ruff_macros Avoid including nursery rules in linter-level selectors (#5268) 2023-06-21 20:11:40 +00:00
ruff_python_ast Visit AugAssign target after value (#5325) 2023-06-23 09:54:54 -04:00
ruff_python_formatter Fix unstable set comprehension formatting (#5327) 2023-06-23 11:50:24 +02:00
ruff_python_semantic Respect `abc` decorators when classifying function types (#5315) 2023-06-22 19:52:36 +00:00
ruff_python_stdlib Replace static `CallPath` vectors with `matches!` macros (#5148) 2023-06-16 17:34:42 +00:00
ruff_python_whitespace Use consistent `Cargo.toml` metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_rustpython Use consistent `Cargo.toml` metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_testing_macros Use consistent `Cargo.toml` metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_textwrap Use consistent `Cargo.toml` metadata in all crates (#5015) 2023-06-12 00:02:40 +00:00
ruff_wasm Move `copyright` rules to `flake8_copyright` module (#5236) 2023-06-21 01:56:40 +00:00