Optionally check that we don't have duplicate nodes after AST merge#4647
Merged
Optionally check that we don't have duplicate nodes after AST merge#4647
Conversation
Collaborator
Author
|
Currently this will actually find many duplicate nodes. I will fix these issues in separate PRs after this has been merged. |
msullivan
approved these changes
Feb 27, 2018
Collaborator
msullivan
left a comment
There was a problem hiding this comment.
Looks good, modulo the type error
mypy/server/mergecheck.py
Outdated
| if t in ('dict', 'tuple', 'SymbolTable', 'list'): | ||
| result += '[%s]' % repr(attr) | ||
| else: | ||
| if t == 'Var': |
Collaborator
There was a problem hiding this comment.
mypy doesn't like this because it doesn't know about the type.
What's the reason for doing this based on the name of the type instead of the type?
carljm
added a commit
to carljm/mypy
that referenced
this pull request
Mar 6, 2018
* master: New files shouldn't trigger a coarse-grained rebuild in fg cache mode (python#4669) Bump version to 0.580-dev Update revision history for 0.570 (python#4662) Fine-grained: Fix crashes when refreshing synthetic types (python#4667) Fine-grained: Support NewType and reset subtype caches (python#4656) Fine-grained: Detect changes in additional TypeInfo attributes (python#4659) Fine-grained: Apply semantic analyzer patch callbacks (python#4658) Optimize fine-grained update by using Graph as the cache (python#4622) Cleanup check_reverse_op_method (python#4017) Fine-grained: Fix AST merge issues (python#4652) Optionally check that we don't have duplicate nodes after AST merge (python#4647)
yedpodtrzitko
pushed a commit
to kiwicom/mypy
that referenced
this pull request
Mar 15, 2018
…ython#4647) It's hard to manually ensure that all relevant nodes are merged in AST merge and that no references to stale objects remain. This automated opt-in check looks for these duplicate nodes. It can be enabled in tests by switching `mypy.test.testfinegrained.CHECK_CONSISTENCY` to True. This was originally implemented by @msullivan. I did various minor changes and some refactoring.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's hard to manually ensure that all relevant nodes are merged in AST merge
and that no references to stale objects remain. This automated opt-in check
looks for these duplicate nodes. It can be enabled in tests by switching
mypy.test.testfinegrained.CHECK_CONSISTENCYto True.This was originally implemented by @msullivan. I did various minor changes
and some refactoring.