This PR replaces the 3rd party search tool (ag) with a native go implementation to read and search for files. In regards to comparing the diff, I'd recommend reviewing this PR as if it is a complete rewrite of all search functionality
Some known improvements from ag:
Removing a 3rd party dependency that has varying performance characteristics and compatibility across our supported platforms
Faster performance. I haven't benchmarked on a realistic CI environment (circleci, github actions, etc) yet, but I've seen up to 5x speed improvements compared to results on test repositories . (resolves https://github.com/launchdarkly/ld-find-code-refs/issues/90)
Edge case: support searching files with colons in their path -- any file like this would break coderefs before because of a regular expression we used to parse ag output
Test coverage: a native implementation is inherently easier to test. Coverage of new code is >90%: files.gosearch.go
TODO:
[x] Replace unit tests
[x] Follow up review of old to new unit tests to make sure we didn't miss any edge cases
This PR replaces the 3rd party search tool (ag) with a native go implementation to read and search for files. In regards to comparing the diff, I'd recommend reviewing this PR as if it is a complete rewrite of all search functionality
Some known improvements from
ag
:.ldignore
:ag
does not support the!
operator (https://github.com/ggreer/the_silver_searcher/issues/1233), the native implementation does.ag
outputTODO: