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
[MSHARED-1326] Improve (documentation on) MavenReport interface #19
Conversation
@kriegaex I'd first to normalize the following:
vs.
vs.
I believe that the last one is logically wrong. I hink it solely refers to the report itself and not the rest. It provides false information.
WDYT? |
I do not think so, because it dependes on the context and the assumptions under which users read the documentation. My context is obviously different from yours, which is why you think it is logically wrong. Maybe it is also a grammatical question to some degree. I prefer "report base (...) directory" to "base report (...) directory", as the latter seems to be bad English. It is a base directory. What kind of base directory? A report base directory, not a base directory for anything else. Which is why I would order the terms that way. As for "a lot (of medicine) helps a lot" or combining the terms, making the result an even more unweildy "shared base report output directory" or "shared report base output directory" as the lesser evil, I am not sure if that might not be too subtle for most plugin developers to grasp. In such cases, a little bit of explanation usually helps, why I usually just expand the description, maybe even adding an instructive example. Precise and to the point is good, but sometimes too terse. I leave the decision up to you, but you asked "WDYT?", so these are my two cents. |
@elharo As you are a native English speaker and we don't, would you mind to add your opinion on this? |
@@ -53,7 +53,9 @@ public interface MavenReport { | |||
void generate(Sink sink, Locale locale) throws MavenReportException; | |||
|
|||
/** | |||
* Get the base name used to create report's output file(s). | |||
* Get the output name denoting a base location relative to the {@link #getReportOutputDirectory()} |
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.
This one is a little hard to describe because what the API does is complicated. On first read, I thought this was just a file name but it's not. But now I read it a third time and maybe it is just a file name? I don't know.
If it is just a file name, then "Returns the name of the output file that will be written in {@link #getReportOutputDirectory()}"
If it can contain subdirectories, then "Returns a path relative to {@link #getReportOutputDirectory()} where the output file will be written."
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.
@elharo, what it contains (file or subdirectory) depends on whether it is a single or multi page report. Javadoc would be an example for multi page.
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.
OK, so maybe it's a directory name? All of this should be laid out in the docs. What might help is a longish class comment explaining where the report files go and how they're configured.
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.
@elharo, it is both. A path to a file. I need to rename the API to satisfy this. I could do with a default interface method. The current name is just bad. I am happy to accept any reformulation of the docs which make it better. Should I raise a PR to rename the method and deprecate it? FWIW, it is not necessarily a file name because it is free of a format. The plugin impl does not decide about the format. It is a symbolic name in a virtual FS, so to speak.
@@ -84,14 +86,17 @@ public interface MavenReport { | |||
String getDescription(Locale locale); | |||
|
|||
/** | |||
* Set a new output directory. Useful for staging. | |||
* Set a new shared base report output directory. This directory may contain output of other |
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.
I'm not sure the word "base" adds anything here
output of --> the output of
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.
@elharo: It adds the notion that not necesarily all reports end up directly in that directory, but that they can also end up in a subdirectory. A base directory is the flipside of the medal regarding the term subdirectory. Of course, without the "base" prefix, that would still hold true, but like I said in an earlier comment: Maximally terse descriptions are not always ideal from a reader's perspective. BTW, the reader inevitably knows way less about the meaning of parameters than the provider. She is also unlikely to read all documentation, but only as little as possible to solve her problem or implement her use case. I.e., she does not have the full context. And even if she does, she is unlikely to remember all of it.
@elharo I tried to apply all of your comments. Maybe the method has to renamed to: String getOutputPath() since |
d034eb6
to
60b9d47
Compare
Now added |
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.
good clarification
Is the method name change acceptable for you and reasonable? |
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.
LGTM
@kriegaex, any further objections before I merge this one? |
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.
Thanks for the improvement. Like boyscouts, you guys in your joint effort left the camp ground behind cleaner than you found it. 🙂
A possible improvement w/o renaming any methods.