mirror of
https://github.com/Instagram/LibCST.git
synced 2025-12-23 10:35:53 +00:00
In certain cases (e.g. inside Instagram's lint framework) we know that our tree originates from the parser, so we know that there shouldn't be any duplicate nodes in our tree. MetadataWrapper exists to copy the tree ensuring that there's no duplicate nodes. This diff provides an escape hatch on MetadataWrapper that allows us to save a little time and avoid a copy when we know that it's safe to skip the copy. As part of this, I ran into some issues with `InitVar` and pyre, so I removed `@dataclass` from the class. This means that this is techincally a breaking change if someone depended on the MetadataWrapper being an actual dataclass, but I think this is unlikely. I implemented `__repr__` and added tests for hashing/equality behavior. |
||
|---|---|---|
| .. | ||
| _static | ||
| _templates | ||
| best_practices.rst | ||
| conf.py | ||
| experimental.rst | ||
| index.rst | ||
| matchers.rst | ||
| matchers_tutorial.ipynb | ||
| metadata.rst | ||
| metadata_tutorial.ipynb | ||
| motivation.rst | ||
| nodes.rst | ||
| parser.rst | ||
| scope_tutorial.ipynb | ||
| tutorial.ipynb | ||
| visitors.rst | ||
| why_libcst.rst | ||