From 37e7a055e3db04e7618393ae629b927b38978d34 Mon Sep 17 00:00:00 2001 From: Nehan Pathan Date: Fri, 17 Oct 2025 15:23:12 +0530 Subject: [PATCH 1/3] Reserve LuceneDev6001-6003 and add initial entries for string/span/char analyzer rules --- DiagnosticCategoryAndIdRanges.txt | 6 +++--- .../AnalyzerReleases.Unshipped.md | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/DiagnosticCategoryAndIdRanges.txt b/DiagnosticCategoryAndIdRanges.txt index 311d5e2..f8e5bce 100644 --- a/DiagnosticCategoryAndIdRanges.txt +++ b/DiagnosticCategoryAndIdRanges.txt @@ -11,16 +11,16 @@ # 4. Your rule ID is now reserved and can be used in your PR. # # In the event of conflict in step 3, make sure you discard your changes, pull latest, and try again. -# DO NOT remove ID ranges already defined or merge this file in git. +# DO NOT remove ID ranges already defined or merge this file in git. # Design: LuceneDev1000-LuceneDev1008 Globalization: Mobility: Performance: Security: -Usage: LuceneDev6000 +Usage: LuceneDev6000-LuceneDev6003 Naming: Interoperability: -Maintainability: +Maintainability: Reliability: Documentation: diff --git a/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md b/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md index 188612b..b5bba5e 100644 --- a/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md +++ b/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md @@ -1,7 +1,10 @@ ### New Rules - Rule ID | Category | Severity | Notes ----------------|----------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------- - LuceneDev1007 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (value type value) - LuceneDev1008 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (reference type value) - LuceneDev6000 | Usage | Info | IDictionary indexer may be used to retrieve values, but must be checked for null before using the value +| Rule ID | Category | Severity | Notes | +| ------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| LuceneDev1007 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (value type value) | +| LuceneDev1008 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (reference type value) | +| LuceneDev6000 | Usage | Info | IDictionary indexer may be used to retrieve values, but must be checked for null before using the value | +| LuceneDev6001 | Usage | Error | String overloads of StartsWith/EndsWith/IndexOf/LastIndexOf must be called with StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase | +| LuceneDev6002 | Usage | Warning | Span overloads of StartsWith/EndsWith/IndexOf/LastIndexOf should not pass non-Ordinal StringComparison | +| LuceneDev6003 | Usage | Info | Single-character string arguments should use the char overload of StartsWith/EndsWith/IndexOf/LastIndexOf instead of a string | From 6e47421a6041514d0f1ef8d99fa99266503bc2ed Mon Sep 17 00:00:00 2001 From: Nehan Pathan Date: Fri, 17 Oct 2025 15:23:12 +0530 Subject: [PATCH 2/3] Reserve LuceneDev6001-6003 and add initial entries for string/span/char analyzer rules --- .../AnalyzerReleases.Unshipped.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md b/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md index b5bba5e..2bcbe6f 100644 --- a/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md +++ b/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md @@ -1,10 +1,10 @@ ### New Rules -| Rule ID | Category | Severity | Notes | -| ------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -| LuceneDev1007 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (value type value) | -| LuceneDev1008 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (reference type value) | -| LuceneDev6000 | Usage | Info | IDictionary indexer may be used to retrieve values, but must be checked for null before using the value | -| LuceneDev6001 | Usage | Error | String overloads of StartsWith/EndsWith/IndexOf/LastIndexOf must be called with StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase | -| LuceneDev6002 | Usage | Warning | Span overloads of StartsWith/EndsWith/IndexOf/LastIndexOf should not pass non-Ordinal StringComparison | -| LuceneDev6003 | Usage | Info | Single-character string arguments should use the char overload of StartsWith/EndsWith/IndexOf/LastIndexOf instead of a string | + Rule ID | Category | Severity | Notes +---------------|----------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------- + LuceneDev1007 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (value type value) + LuceneDev1008 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (reference type value) + LuceneDev6000 | Usage | Info | IDictionary indexer may be used to retrieve values, but must be checked for null before using the value + LuceneDev6001 | Usage | Error | String overloads of StartsWith/EndsWith/IndexOf/LastIndexOf must be called with StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase + LuceneDev6002 | Usage | Warning | Span overloads of StartsWith/EndsWith/IndexOf/LastIndexOf should not pass non-Ordinal StringComparison + LuceneDev6003 | Usage | Info | Single-character string arguments should use the char overload of StartsWith/EndsWith/IndexOf/LastIndexOf instead of a string From 5e425268a4a8b21b36d3c76edf0efdc8ef6f29ae Mon Sep 17 00:00:00 2001 From: Nehan Pathan Date: Fri, 17 Oct 2025 17:00:26 +0530 Subject: [PATCH 3/3] fix: correct table format in AnalyzerReleases.Unshipped.md to resolve build warning --- .../AnalyzerReleases.Unshipped.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md b/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md index 2bcbe6f..30950e2 100644 --- a/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md +++ b/src/Lucene.Net.CodeAnalysis.Dev/AnalyzerReleases.Unshipped.md @@ -1,10 +1,10 @@ ### New Rules - Rule ID | Category | Severity | Notes ----------------|----------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------- - LuceneDev1007 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (value type value) - LuceneDev1008 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (reference type value) - LuceneDev6000 | Usage | Info | IDictionary indexer may be used to retrieve values, but must be checked for null before using the value - LuceneDev6001 | Usage | Error | String overloads of StartsWith/EndsWith/IndexOf/LastIndexOf must be called with StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase - LuceneDev6002 | Usage | Warning | Span overloads of StartsWith/EndsWith/IndexOf/LastIndexOf should not pass non-Ordinal StringComparison - LuceneDev6003 | Usage | Info | Single-character string arguments should use the char overload of StartsWith/EndsWith/IndexOf/LastIndexOf instead of a string +Rule ID | Category | Severity | Notes +--------------|----------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------- +LuceneDev1007 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (value type value) +LuceneDev1008 | Design | Warning | Generic Dictionary indexer should not be used to retrieve values because it may throw KeyNotFoundException (reference type value) +LuceneDev6000 | Usage | Info | IDictionary indexer may be used to retrieve values, but must be checked for null before using the value +LuceneDev6001 | Usage | Error | String overloads of StartsWith/EndsWith/IndexOf/LastIndexOf must be called with StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase +LuceneDev6002 | Usage | Warning | Span overloads of StartsWith/EndsWith/IndexOf/LastIndexOf should not pass non-Ordinal StringComparison +LuceneDev6003 | Usage | Info | Single-character string arguments should use the char overload of StartsWith/EndsWith/IndexOf/LastIndexOf instead of a string