LibCST/libcst/metadata/tests
Benjamin Woodruff 42c3f3f267 Add an unsafe_skip_copy option to MetadataWrapper
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.
2019-10-29 13:35:38 -07:00
..
__init__.py Add __init__ to metadata/tests 2019-08-06 16:58:56 -07:00
test_base_provider.py consolidate metadata imports 2019-10-01 13:40:24 -07:00
test_expression_context_provider.py rewrite ExpressionContextProvider to handle nested List/Tuple and Attribute 2019-10-04 15:16:55 -07:00
test_metadata_provider.py consolidate metadata imports 2019-10-01 13:40:24 -07:00
test_metadata_wrapper.py Add an unsafe_skip_copy option to MetadataWrapper 2019-10-29 13:35:38 -07:00
test_parent_node_provider.py consolidate metadata imports 2019-10-01 13:40:24 -07:00
test_position_provider.py Add a reentrant (incremental) codegen API 2019-10-28 17:23:26 -07:00
test_qualified_name_provider.py Update black to git commit that fixes 3.8 support. 2019-10-24 15:25:21 -07:00
test_reentrant_codegen.py Add a reentrant (incremental) codegen API 2019-10-28 17:23:26 -07:00
test_scope_provider.py Update black to git commit that fixes 3.8 support. 2019-10-24 15:25:21 -07:00