detect-secrets-server icon indicating copy to clipboard operation
detect-secrets-server copied to clipboard

Fix exclude_regex functionality (Issue 17)

Open sp3nx0r opened this issue 5 years ago • 4 comments

Addresses https://github.com/Yelp/detect-secrets-server/issues/17 and https://github.com/Yelp/detect-secrets-server/issues/44

Removes exclude_regex from tracked repo metadata and config yaml add and replaces with an exclude_files_regex and exclude_lines_regex. CLI args are appended to the repo args (but are not overwritten in tracked repo metadata).

sp3nx0r avatar Jan 22 '20 20:01 sp3nx0r

Thanks so much for making this! 🙏 I will take a look at it this weekend

KevinHock avatar Jan 24 '20 17:01 KevinHock

(Gonna review after Tavis passes currently get a

            self.add_non_local_repo(mock_rootdir)
    
>       assert not mock_file_operations.write.called
E       AssertionError: assert not True
E        +  where True = <MagicMock name='open().write' id='139948498142936'>.called
E        +    where <MagicMock name='open().write' id='139948498142936'> = <MagicMock name='open()' id='139948498142488'>.write
tests/actions/initialize_test.py:243: AssertionError
===================== 1 failed, 97 passed in 1.22 seconds ======================

I think)

KevinHock avatar Jan 28 '20 00:01 KevinHock

(Gonna review after Tavis passes currently get a

            self.add_non_local_repo(mock_rootdir)
    
>       assert not mock_file_operations.write.called
E       AssertionError: assert not True
E        +  where True = <MagicMock name='open().write' id='139948498142936'>.called
E        +    where <MagicMock name='open().write' id='139948498142936'> = <MagicMock name='open()' id='139948498142488'>.write
tests/actions/initialize_test.py:243: AssertionError
===================== 1 failed, 97 passed in 1.22 seconds ======================

I think)

Similar test case modification for the empty repo PR #46. Will open a new issue to handle overriding globally because maybe someone wants to not always override?

sp3nx0r avatar Jan 28 '20 16:01 sp3nx0r

Looks like this PR pushed us under 93% coverage in Travis:

ERROR: InvocationError for command /home/travis/build/Yelp/detect-secrets-server/.tox/pypy/bin/coverage report --show-missing '--include=detect_secrets_server/*' --fail-under 93 (exited with code 2)

sp3nx0r avatar Feb 03 '20 15:02 sp3nx0r