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

Preserving comments #85

Open
paulvi opened this issue Apr 19, 2016 · 7 comments
Open

Preserving comments #85

paulvi opened this issue Apr 19, 2016 · 7 comments

Comments

@paulvi
Copy link
Contributor

paulvi commented Apr 19, 2016

While translating (e.g. migrating from .xml) information written in comments is lost.

Comments before/after any section can't be in Model, so it is for translators to keep more data

@mosabua
Copy link
Member

mosabua commented Mar 2, 2018

This seems to be a non-crucial feature and I am inclined to close the issue. Any objections? Or anybody wanting to send a PR that implements it for the various dialects? Or for one as an example at least?

@paulvi
Copy link
Contributor Author

paulvi commented Mar 5, 2018

objection. I consider pom as code, and comments to be important part of it.

For example, why a dependency is needed, or what a plugin is for.
In team environment it is important to preserve knowledge, and tools should help, not constrain.

@mosabua
Copy link
Member

mosabua commented Mar 6, 2018

Fair point. Wanna send a PR?

@mkristian
Copy link
Contributor

we can do translate POMs back and forth. the translation from pom.xml to pom.rb is straight forward, the other way around you have builder methods here and there, so a lot of coding around the actual DSL. I doubt a general translation of comments to xml-comments is feasible and can be meaningful.

@lefou
Copy link
Contributor

lefou commented Mar 6, 2018

Although I'm not saying preserving the comments isn't possible (in fact, I have some ideas), I would argue, it is not worth the effort. Or at least not for those dialects representing full programming languages like the ruby or scala dialect.

In most cases I use the translation from XML only once, to have an initial starting point. Later I use the translation to XML whenever I need integration into other tools. But the output looks more like the result of help:effective-pom, which doesn't preserve comments neither (I didn't checked). As the generated XML has a very different struckture than the source pom.scala, any preserved comment would have a high potential to tell a lie.

@lefou
Copy link
Contributor

lefou commented Mar 6, 2018

What I really want is a single most prominent comment saying, that the file was generated. But that's another story.

@jdimeo
Copy link

jdimeo commented Apr 26, 2020

I would vote more for preserving comments from original translation from XML as being more important than preserving them back to XML after editing

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

No branches or pull requests

5 participants