Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape Nodelet/tag names for Dot as well. #1

Conversation

NHDaly
Copy link
Owner

@NHDaly NHDaly commented Oct 5, 2020

This escaping requirement was previously leaking into the implementation
of graph.go, by writing \n directly instead of "\n". This meant that
if it was displayed in a different program besides dot, it would have
been potentially incorrectly escaped.

Now, this commit moves all the escaping directly into dotgraph, which is
more encapsulated, and also allows us to escape other characters in the
name which need escaping.

This required adding a justify option to escapeForDot to preserve old behavior.
This allows tag newlines to stay center justified, and legend label
newlines to stay left justified, as they were before we started escaping
them for Dot.


This PR is a follow-up to google#564, opened here instead of google#568.

This escaping requirement was previously leaking into the implementation
of `graph.go`, by writing `\n` directly instead of "\n". This meant that
if it was displayed in a different program besides `dot`, it would have
been potentially incorrectly escaped.

Now, this commit moves all the escaping directly into dotgraph, which is
more encapsulated, and also allows us to escape other characters in the
name which need escaping.
This allows tag newlines to stay center justified, and legend label
newlines to stay left justified, as they were before we started escaping
them for Dot.

Also ran gofmt
@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2020

Codecov Report

Merging #1 into nhd-dotgraph-escape-labels will increase coverage by 0.03%.
The diff coverage is 94.44%.

Impacted file tree graph

@@                      Coverage Diff                       @@
##           nhd-dotgraph-escape-labels       #1      +/-   ##
==============================================================
+ Coverage                       67.12%   67.16%   +0.03%     
==============================================================
  Files                              39       39              
  Lines                            7033     7041       +8     
==============================================================
+ Hits                             4721     4729       +8     
  Misses                           1899     1899              
  Partials                          413      413              
Impacted Files Coverage Δ
internal/graph/graph.go 27.87% <0.00%> (ø)
internal/graph/dotgraph.go 90.62% <100.00%> (+0.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dff1afc...8c597aa. Read the comment docs.

@NHDaly NHDaly force-pushed the nhd-dotgraph-escape-labels branch 5 times, most recently from 28a8f81 to 9061b08 Compare October 24, 2020 20:54
@NHDaly
Copy link
Owner Author

NHDaly commented Feb 17, 2022

closing this stale PR

@NHDaly NHDaly closed this Feb 17, 2022
@NHDaly NHDaly deleted the nhd-dotgraph-escape-labels--escape-Tags branch February 17, 2022 04:50
@NHDaly NHDaly restored the nhd-dotgraph-escape-labels--escape-Tags branch February 17, 2022 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants