You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
my favorite is now _PYTEAL_HYBRID_UNPARSED: "| " + yapf_api.FormatCode (self.hybrid_unparsed(), style_config="{COLUMN_LIMIT:80}")[0].strip().replace ('\n','\n//'),
tzaffi
changed the title
Source Mapping: Better options for Annotated Teal
Source Mapper Improvements: Better options for Annotated Teal
Feb 23, 2023
tzaffi
changed the title
Source Mapper Improvements: Better options for Annotated Teal
Source Mapper Improvements: Better Options for Annotated Teal
Feb 23, 2023
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
tabulate
package and it has a multi-line mode. We could leverage it as well to wrap columns that are too wideblack
library with a very tight column width?Dependencies
#650
Urgency
Estimating: Medium. This should be reevaluated based on reception by end users.
The text was updated successfully, but these errors were encountered: