-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Labels
Description
Problem in Upcoming Source Map Feature
When source mapping is enabled and annotated teal generated, there is no mechanism to limit the width of produced lines.
For example, @bbroder-algo generated a source map for code residing in this repo (this is the "Rock Paper Scissors" example from a recent bootcamp), and then ran it through YAPF to wrap very long files, he obtained this snippet:
We can see that Compilation(approval_program(),... ...=True)
got wrapped because it was too long.
If possible, we'd like to have handling long lines built in to the source mapper, so users don't need to each solve this problem for themselves.
Possible Solutions
- Use the YAPF library linked above directly, and just wrap past a certain column width
- The source mapper uses the
tabulate
package and it has a multi-line mode. We could leverage it as well to wrap columns that are too wide - We could simply truncate columns that are too wide
- Should we try to use the
black
library with a very tight column width? - something else?
Dependencies
Urgency
Estimating: Medium. This should be reevaluated based on reception by end users.