Add ignore case functionality for search patterns #35
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.
This pull request primarily introduces the 'ignore case' feature to the CLI application, allowing users to ignore case sensitivity in regular expressions. It also adds a new 'cover' target to the Makefile to generate a coverage report.
Here are the most important changes:
Addition of 'ignore case' feature:
internal/cli/cli.go
: Added a newignoreCase
field to theCLI
struct [1]. This field is used to determine whether to ignore case sensitivity in regular expressions. TheRun
andparseFlags
methods were updated to accommodate this new field [2] [3] [4]. ThecompileRegexps
function was also modified to prefix all regular expressions with(?i)
ifignoreCase
is true [5].internal/cli/cli_test.go
: Updated the tests to check the 'ignore case' feature. New test cases were added toTestRun_successProcess
andTestCompileRegexps
to test the functionality of the 'ignore case' feature [1] [2] [3]. TheTestFilterProcess
test was updated to use the newcompileRegexps
function signature [4].internal/cli/export_test.go
: Updated theCompileRegexps
function to use the newcompileRegexps
function signature.Addition of 'cover' target in Makefile:
Makefile
: Added a new 'cover' target that generates a coverage report usinggo test -coverprofile
andgo tool cover -html
.Test data changes:
internal/cli/testdata/test.txt
: Added a new line with different casing to test the 'ignore case' feature.