-
Notifications
You must be signed in to change notification settings - Fork 172
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
Add Diagnostics for Maven Name and Description #2405
Add Diagnostics for Maven Name and Description #2405
Conversation
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: |
...ava-processor/src/main/java/com/azure/tools/apiview/processor/analysers/JavaASTAnalyser.java
Show resolved
Hide resolved
...zure/tools/apiview/processor/diagnostics/rules/MavenPackageAndDescriptionDiagnosticRule.java
Outdated
Show resolved
Hide resolved
private static final Pattern MAVEN_NAME = Pattern.compile("Microsoft Azure client library for .*"); | ||
private static final Pattern MAVEN_DESCRIPTION = | ||
Pattern.compile("This package contains the Microsoft Azure .* client library"); |
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.
Since we are using the same diagnostic rules for Spring, ARM and Android, this rule may not apply to them.
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.
Yep - you should enforce common description styles for each separately.
Hi @alzimmermsft. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
diagnostics.add(new MavenPackageAndDescriptionDiagnosticRule( | ||
MavenPackageAndDescriptionDiagnosticRule.DEFAULT_MAVEN_NAME, | ||
MavenPackageAndDescriptionDiagnosticRule.DEFAULT_MAVEN_DESCRIPTION)); |
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.
We can instead have an empty args ctor for MavenPackageAndDescriptionDiagnosticRule that uses the default name and description.
String nameId = getId("name", pom.getName()); | ||
if (!mavenName.matcher(pom.getName()).matches()) { | ||
listing.addDiagnostic(new Diagnostic(DiagnosticKind.WARNING, nameId, | ||
"Maven library name should follow the pattern 'Microsoft Azure client library for <service name>'.", |
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.
Shouldn't this diagnostic message use the name passed in to the ctor?
if (!mavenName.matcher(pom.getName()).matches()) { | ||
listing.addDiagnostic(new Diagnostic(DiagnosticKind.WARNING, nameId, | ||
"Maven library name should follow the pattern 'Microsoft Azure client library for <service name>'.", | ||
"https://azure.github.io/azure-sdk/java_introduction.html#java-maven-name")); |
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.
How do we get the link for non-default names?
String descriptionId = getId("description", pom.getDescription()); | ||
if (!mavenDescription.matcher(pom.getDescription()).matches()) { | ||
listing.addDiagnostic(new Diagnostic(DiagnosticKind.WARNING, descriptionId, | ||
"Maven library description should follow the pattern 'This package contains the Microsoft Azure <service> client library'.", |
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.
Same here - use description provided in the ctor.
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
Adds diagnostics to Java's ApiView for the Maven package name and description. Additionally, makes minor changes to the
NoLocalesInJavadocUrlDiagnosticRule
to use a single passPattern
instead of looping on containing each individual locale tested.