-
Notifications
You must be signed in to change notification settings - Fork 5
Add analyzer and code fix for public types in Lucene.Net.Support, #1100 #2
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
Conversation
41814e2 to
7781469
Compare
7781469 to
fa11b30
Compare
NightOwl888
left a comment
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. This looks pretty good.
However, we are still figuring things out, so I left some comments on some of these issues. Do note that some of them are not directly related to this PR, so they could be made into new issues.
I noticed that we are getting build warnings for the AnalyzerReleases.Shippped.md file containing invalid version numbers. Apparently, the tool doesn't support pre-release numbers.
https://chatgpt.com/share/68d915a1-9d28-8005-8ee4-b0934776fdaf
So, for sure we need to change the Git commit hook to only put the major and minor components of the version into the file. We may also consder moving these back into "Unshipped" state until the official 1.0 release. It sounds like we should only be updating that doc when the production version number changes or alternatively, migrate all new rules into the 1.0 release as each pre-release is shipped and create a new section only for the next production release.
Whatever direction we go, we will need to update the make-release.md document with the new info.
...et.CodeAnalysis.Dev/LuceneDev1xxx/LuceneDev1005_LuceneNetSupportPublicTypesCSCodeAnalyzer.cs
Show resolved
Hide resolved
...is.Dev.CodeFixes/LuceneDev1xxx/LuceneDev1005_LuceneNetSupportPublicTypesCsCodeFixProvider.cs
Outdated
Show resolved
Hide resolved
NightOwl888
left a comment
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.
Let's also fix the Git commit hook so it only uses the major and minor version to match the expectations of the AnalyzerReleases spec. It is located at:
| version=$(nbgv get-version -v NuGetPackageVersion) |
The nbgv command to use to get the major and minor version and ignore the rest is:
nbgv get-version -v MajorMinorVersionAlso, we should update the make-release.md file to reflect that change in the example.
|
Come to think of it, there is also a |
The code fix was stripping leading trivia (license headers, comments) when changing public to internal. The fix now preserves both leading trivia from the first modifier and trailing trivia from the accessibility modifier being replaced. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Fixed issue with leading/trailing trivia including added unit test coverage. |

NOTE: This requires #1 to be merged first, as it is a stacked PR on top of that one, so it shows all changes from that PR as well. I will rebase it against main once #1 is merged.
This adds a diagnostic and code fix for detecting public types in the Lucene.Net.Support namespace.
Partial apache/lucenenet#1100 (Will still need to add these analyzers to Lucene.NET in order to close that issue)