-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
And tspconfig-java-package-dir Rule for TypeSpec Validation #31951
base: main
Are you sure you want to change the base?
Conversation
Next Steps to Merge✅ All automated merging requirements have been met! To get your PR merged, see aka.ms/azsdk/specreview/merge. |
PR validation pipeline restarted successfully. If there is ApiView generated, it will be updated in this comment. |
eng/tools/typespec-validation/src/rules/tspconfig-java-namepace.ts
Outdated
Show resolved
Hide resolved
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.
Do we have a place to validate part that common to all emitters?
e.g.
parameters:
"service-dir":
default: "sdk/<>"
Please also have approval from dev familiar with lint rule code.
readonly description = | ||
`"options.@azure-tools/typespec-java.package-dir" must match ${this.pattern}.`; | ||
readonly action = | ||
`Please update "options.@azure-tools/typespec-java.package-dir" to start with "azure", followed by one or more "-<word>" segments. Each <word> should consist of letters, digits, or underscores. For example: "azure-test".`; |
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.
Is there better way to say "should consist of letters, digits, or underscores"? Mostly Java only want letters, but "should consist of" feels we ask them to use all 3.
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.
What about
Please update "options.@azure-tools/typespec-java.package-dir" to start with "azure", followed by one or more "-" segments. Each should consist of letters, digits, or underscores (any combination or subset). For example: "azure-test".
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.
Maybe "Each segment can contain letters, digits, ..."?
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.
Updated
Yes, we will have it in the future. This PR is a start to add rules for tspconfig |
Issue: Azure/azure-sdk-tools#9355
Limit tspconfig.options.["@azure-tools/typespec-java"].["package-dir"] matches
/^azure(-\w+)+$/