Repository navigation
Use the real API names in the README samples and reference [patch] - #178
Open
matt-edmondson wants to merge 2 commits into
Open
matt-edmondson wants to merge 2 commits into
matt-edmondson wants to merge 2 commits into
Conversation
The README samples called TextFilter.Match, MatchOptions.* and FilterType.*, none of which exist, so every first sample a new user copied failed with CS0117/CS0103. The API reference documented WholeString as the default match option (it is ByWordAny) and a Rank overload that takes match options (there is none), and the FuzzySearch acknowledgement linked the old ktsu-io repo. The samples now use IsMatch, TextFilterType and TextFilterMatchOptions. The reference lists the real IsMatch, Filter, Rank and GetHint overloads with their defaults, and the enum tables mark which value is the default. ReadmeTests checks every Type.Member in the README's C# blocks, and every method and default in the API reference table, against the library by reflection, so the README can't drift from the API again unnoticed. Fixes #138 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5rmwEcdN9nYifxAwK
Path.Combine drops earlier segments when a later one is rooted; Path.Join doesn't, and matches how the other ktsu test suites build these paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5rmwEcdN9nYifxAwK
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #138
What was wrong
README.md is also the nuget.org package page, and most of its C# samples didn't compile:
TextFilter.Match(...)TextFilter.IsMatch(...)MatchOptions.AnyWord/AllWords/WholeStringTextFilterMatchOptions.ByWordAny/ByWordAll/ByWholeStringFilterType.Glob/Regex/FuzzyTextFilterType.Glob/Regex/FuzzyWholeStringByWordAny, as in the method signaturesRank(..., MatchOptions options)in the API referenceRank(strings, fuzzyFilter)andRank<TItem>(items, keySelector, fuzzyFilter)ktsu-io/ktsu.FuzzySearchktsu-dev/FuzzySearchThe API reference now also lists the
IsMatch(..., out int score, ...)overload,Filter<TItem>andGetHint. The Match Options sample now shows the result of each call:true,false,falseunder the default case-sensitive matching.Test
TextFilter.Test/ReadmeTests.csreads the README and checks it against the library by reflection:Type.Memberin a C# block (after stripping string literals and//comments) must be a public static member of aktsu.TextFiltertypeI ran the new tests against the old README and two of them failed, naming exactly the problems in the issue:
With the new README, the full suite passes (218/218).
Open PR #163 adds a "Glob Character Classes" section next to the Case Sensitivity section. This PR doesn't touch those lines.
Generated by Claude Code