Tags: dosisod/refurb
Tags
Pin Mypy to <1.7.0 (#306): Temporarily fixes #305. Specifically, this error is being caused by this line: https://github.com/python/mypy/blob/e4355948d797600c7b76da0a916fc5f29d10448e/mypy/traverser.py#L97 Because `TraverserVisitor` now is a `trait` you cannot extend from it. There doesn't seem to be a way to get around this on my end, so I'm pinning Mypy as a workaround until I find a solution or something changes upstream with Mypy.
Skip files that raise `RecursionError` (#304): Certain deeply-nested expressions cause the Refurb visitor to blow the stack. This doesn't seem to be an issue when running 6DD7 with Mypy directly, though this is probably because we are traversing the entire AST. As a workaround we will silently ignore files that cause this issue. For debugging purposes there should probably be a flag to show files that have been ignored (perhaps just stuff it under the `-v` flag for now). Also bump version for new release. Closes #302.
Add better detection of list/set comprehensions (#300): See #298 (comment) This PR adds better detection of list/set comprehensions. Previously Refurb checks ran depth first, meaning that the leaf nodes where the first nodes to be hit. Now the checks are ran before traversing, meaning checks will run on the root nodes first. This allows checks more flexibility, though for this PR, it allows them to ignore nodes that they have already seen which prevents multiple errors being emitted in certain circumstances. Also bump version for new release.
PreviousNext