-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support all kind of tags in DefaultDocWorkUnitHandler #70
Open
magicDGS
wants to merge
2
commits into
broadinstitute:master
Choose a base branch
from
bioinformagik:dgs_not_inline_tags
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I agree there is a problem with how we're processing the tags, I'm not sure this fixes the problem (or maybe I don't understand what you're trying to achieve here). The custom tags feature was intended to allow customizations that could be used from within the Freemarker template; for example, GATK3 tools had a "walker type" annotation, but GATK4 doesn't. So this was an attempt to allow that kind of functionality to be replaced with a tag, i.e.: "{@gatk:WalkerType ReadWalker}. We're not actually depending on that in GATK at the moment, but thats how I intended the feature would be used.
AFAICT, this change breaks that (sadly, it appears we don't have a good test for it). With this change, an embedded tag such as "{@gatk:WalkerType ReadWalker}" wouldn't be recognized anymore (that is, it would not be returned from the tags() method). For it to be recognized, it would have to be specified without the "{}" delimiters. But if the tag is written that way, the "text" of the tag will include everything in the comment up to start of the next tag, or to the end of the comment if no other tags exist. So I don't think you could use it to categorize a walker type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of other things I noticed:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My aim here is to have tags similar to the javadoc
@see
, but customized. This will allow to remove from the help text this tags and even include them in the normal javadoc. For example:Maybe my change is not working (which is wierd, because it mimics a hack that I did in a custom project to include this feature), but my aim is to populate the "barclay.type" in the JSON, but ignoring it in the documentation text description. In Barclay, the test for round trip is testing the JSON, but the tags are not populated there anyway (I haven't change the expected files); we should either have a test JSON object or implement mocking tests for all this functionality.
I also notice another problem with the tags: if there are repeated tags, they are overridden. For instance, I have the situation when I want to add custom tags with "notes", "warnings", "caveats" and then populate them into the JSON to format them as a list. That's actually why I started with this: I do not want to have them embedded in the description (in the format
{@doc.warning be careful}
), but being able to process them with the@doc.warning be careful
format to remove them from the doc test. Nevertheless, the problem is when two warnings should be separated, and then one overrides the other.Maybe we should discuss about the tag-support and how it should look like in a different issue, and I should close this PR til we agree on the final shape of this functionality...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@magicDGS I think your example above will work as long as there is no other text in between these two lines:
But I think it would break if it looked like this:
In that case, the custom @barclay.type tag's text will include everything up to the start of the next comment: "simple * Other comment included in between tags".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I realized from looking into this more, and from looking at the GATK beta doc output, that there is a bug in Barclay docgen where in some cases we don't include javadoc after the first embedded tag, at least in some cases. I'll try to fix that ASAP since its fairly high priority. In the meantime, lets leave this PR open for the short term so we can retain this discussion thread, even though we'll probably replace it with another PR with a more comprehensive fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually that's a normal javadoc processing feature. These kind of tags (
@see
,@author
, etc.) are suppose to be at the end of the javadoc instead of embedded in the text. That's why embedded tags such as@link
have the curly-brackets syntax.I think that the fix is to point out that this is like that... and actually IntelliJ re-format the javadoc putting them at the end, so I think that it's fair enough to keep it as it is now...