Benjamin Schubert
283a746dad
pprint: Remove conversion to int, we only accept those
2023-12-18 08:35:57 +00:00
Benjamin Schubert
64b5b665cf
pprint: Remove the option to add underscore for numbers
...
This is never used, we can remove this. If we wanted instead, we could
always enable it
2023-12-18 08:35:57 +00:00
Benjamin Schubert
6aa35f772f
pprint: Remove the option to sort dictionaries, we always do it
2023-12-18 08:35:57 +00:00
Benjamin Schubert
03b24e5b30
pprint: Remove the `format` method, it's not used outside of pprint
...
Let's reduce the API surface for the bundled PrettyPrinter to what we
really need and use
2023-12-18 08:35:57 +00:00
Benjamin Schubert
88c3546006
pprint: use a set instead of a dict for the context
...
This is really what the context is doing, we don't need to use a dict
for it
2023-11-27 22:40:09 +00:00
Benjamin Schubert
50607297f4
pprint: Remove tracking of whether an object is readable
...
This information is not used anywhere
2023-11-27 22:40:09 +00:00
Benjamin Schubert
767f08cecd
pprint: Remove tracking of whether the object is recursive
...
This information is not used anywhere, we can simplify by just not
tracking it
2023-11-27 22:40:09 +00:00
Benjamin Schubert
e5a448cd5f
pprint: Type annotate the module
...
This will make it easier to refactor
2023-11-27 22:40:09 +00:00
Benjamin Schubert
64e72b79f6
pprint: Remove unused arguments on PrettyPrinter
2023-11-27 22:40:09 +00:00
Benjamin Schubert
2d1710e0e9
Improve the full diff by having more consistent indentation in the PrettyPrinter ( #11571 )
...
The normal default pretty printer is not great when objects are nested
and it can get hard to read the diff.
Instead, provide a pretty printer that behaves more like when json get
indented, which allows for smaller, more meaningful differences, at
the expense of a slightly longer diff.
This does not touch the other places where the pretty printer is used,
and only updated the full diff one.
2023-11-27 16:47:18 +02:00
Benjamin Schubert
19934b2b0c
Merge the AlwaysDispathPrettyPrinter into the now vendored PrettyPrinter
...
We don't need to keep the separation anymore, and this will make it
easier to extend
2023-11-20 13:00:00 +00:00
Benjamin Schubert
2953120003
Fix typing information for the pprint module
...
There is more type information that could be added. We can add those
later to make it easier, this is jsut the minimum to allow linting to
pass
2023-11-20 13:00:00 +00:00
Benjamin Schubert
5fae5ef73e
Apply project-wide formatting standard to the pprint module (black)
2023-11-20 13:00:00 +00:00
Benjamin Schubert
66f2f20eff
Run pyupgrade on the pprint module
2023-11-20 13:00:00 +00:00
Benjamin Schubert
2322668344
Remove unneeded pprint interfaces
...
There are parts of the original pprint module that we won't need, let's
limit the surface and remove the unnecessary code
2023-11-20 13:00:00 +00:00
Benjamin Schubert
eb6ad08e5d
Vendor in the pprint module to allow further modifications
...
We already have the AlwaysDispatchingPrettyPrinter override of the
default pretty printer. In order to make more in depth changes, we
need to copy the upstream version in, as it doesn't lend itself well to
being extended.
This does a verbatime copy, adding provenance information at the top.
2023-11-20 13:00:00 +00:00