Closed Avasam closed 3 weeks ago
Most were found thanks to https://docs.astral.sh/ruff/rules/non-augmented-assignment/
Then, since Ruff/PLR6104 doesn't support associative operations (yet https://github.com/astral-sh/ruff/issues/11656), I used the following regex to find more: (\w+?) = (\(\n\s+)\1 ([\+\-\*/\|&%~]|>>|<<|\*\*|//) --> $1 $3= ( (\w+?) = \1 ([\+\-\*/\|&%~]|>>|<<|\*\*|//) --> $1 $2= (\w+?) = f('|")\{\1\} --> $1 += f$2
(\w+?) = (\(\n\s+)\1 ([\+\-\*/\|&%~]|>>|<<|\*\*|//)
$1 $3= (
(\w+?) = \1 ([\+\-\*/\|&%~]|>>|<<|\*\*|//)
$1 $2=
(\w+?) = f('|")\{\1\}
$1 += f$2
Then manually reviewed the whole thing.
Most were found thanks to https://docs.astral.sh/ruff/rules/non-augmented-assignment/
Then, since Ruff/PLR6104 doesn't support associative operations (yet https://github.com/astral-sh/ruff/issues/11656), I used the following regex to find more:
(\w+?) = (\(\n\s+)\1 ([\+\-\*/\|&%~]|>>|<<|\*\*|//)
-->$1 $3= (
(\w+?) = \1 ([\+\-\*/\|&%~]|>>|<<|\*\*|//)
-->$1 $2=
(\w+?) = f('|")\{\1\}
-->$1 += f$2
Then manually reviewed the whole thing.