diff --git a/crs-toolchain b/crs-toolchain new file mode 100644 index 0000000..adef565 Binary files /dev/null and b/crs-toolchain differ diff --git a/util/fp_finder.go b/util/fp_finder.go index d426ae1..52f64e9 100644 --- a/util/fp_finder.go +++ b/util/fp_finder.go @@ -9,6 +9,7 @@ import ( "os" "regexp" "slices" + "sort" "strings" "github.com/coreruleset/crs-toolchain/v2/utils" @@ -75,9 +76,12 @@ func (t *FpFinder) FpFinder(inputFilePath string, extendedDictionaryFilePath str logger.Fatal().Err(err).Msg("Failed to load input file") } - // Filter words not in dictionary, remove duplicates, and sort alphabetically + // Filter words not in dictionary filteredWords := t.filterContent(inputFile, dict, minSize) + // Sort words alphabetically (case-sensitive) + sort.Strings(filteredWords) + // Remove adjacent duplicate words from the sorted list filteredWords = slices.Compact(filteredWords)