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

[MSHARED-1326] Improve (documentation on) MavenReport interface #19

Merged
merged 1 commit into from Nov 6, 2023

Conversation

michael-o
Copy link
Member

@michael-o michael-o commented Oct 22, 2023

A possible improvement w/o renaming any methods.

@michael-o
Copy link
Member Author

michael-o commented Oct 22, 2023

@kriegaex

@michael-o
Copy link
Member Author

@kriegaex I'd first to normalize the following:

shared report output directory

vs.

base report output directory

vs.

report base output directory

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.
Now we have only two left. What is important to me is that plugin authors understand that this is not an exclusive directory. Maybe we need to combine them:

shared base report output directory

WDYT?

@kriegaex
Copy link

I believe that the last one is logically wrong.

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.

@michael-o
Copy link
Member Author

@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()}
Copy link
Contributor

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."

Copy link

@kriegaex kriegaex Nov 2, 2023

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.

Copy link
Contributor

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.

Copy link
Member Author

@michael-o michael-o Nov 2, 2023

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
Copy link
Contributor

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

Copy link

@kriegaex kriegaex Nov 2, 2023

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.

src/main/java/org/apache/maven/reporting/MavenReport.java Outdated Show resolved Hide resolved
src/main/java/org/apache/maven/reporting/MavenReport.java Outdated Show resolved Hide resolved
src/main/java/org/apache/maven/reporting/MavenReport.java Outdated Show resolved Hide resolved
@michael-o
Copy link
Member Author

@elharo I tried to apply all of your comments. Maybe the method has to renamed to:

String getOutputPath()

since Name is misleading...?

@michael-o michael-o requested a review from elharo November 2, 2023 18:56
@asfgit asfgit force-pushed the MSHARED-1326 branch 2 times, most recently from d034eb6 to 60b9d47 Compare November 4, 2023 15:41
@michael-o
Copy link
Member Author

Now added #getOutputPath() and deprecate #getOutputName().

Copy link
Member

@hboutemy hboutemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good clarification

@michael-o
Copy link
Member Author

good clarification

Is the method name change acceptable for you and reasonable?

Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michael-o
Copy link
Member Author

@kriegaex, any further objections before I merge this one?

Copy link

@kriegaex kriegaex left a 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. 🙂

@asfgit asfgit closed this in 65e9ed4 Nov 6, 2023
@asfgit asfgit merged commit 65e9ed4 into master Nov 6, 2023
22 checks passed
@michael-o michael-o deleted the MSHARED-1326 branch November 6, 2023 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants