Git Product home page Git Product logo

git-secrets's People

Contributors

halprin avatar

Watchers

 avatar  avatar  avatar

git-secrets's Issues

Add CI

Add CI for this repository.

Crash on diffs containing `\ No newline at end of file`

git-secrets crashes with a stack trace when a diff contains \ No newline at end of file

$ git --version
git version 2.17.2 (Apple Git-113)

$ git diff Dockerfile
diff --git a/Dockerfile b/Dockerfile
index e8bf065..8159cfd 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -41,4 +41,4 @@ CMD ["bash"]
 #FROM dependencies as ci
 #
 #RUN flake8
-#RUN pytest --include-long-tests
+#RUN pytest --include-long-tests
\ No newline at end of file

$ git add Dockerfile

$ git commit -m "Test commit"
Traceback (most recent call last):
  File "/Users/jess/.pyenv/versions/3.6.6/bin/git-secrets", line 11, in <module>
    sys.exit(cli())
  File "/Users/jess/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/jess/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/jess/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/jess/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/jess/.pyenv/versions/3.6.6/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/jess/.pyenv/versions/3.6.6/lib/python3.6/site-packages/git_secrets/cli/scan.py", line 8, in scan
    internal.scan()
  File "/Users/jess/.pyenv/versions/3.6.6/lib/python3.6/site-packages/git_secrets/secrets/scan.py", line 14, in scan
    diff = git.staged_diff()
  File "/Users/jess/.pyenv/versions/3.6.6/lib/python3.6/site-packages/git_secrets/secrets/git.py", line 10, in staged_diff
    patch_set = PatchSet.from_string(staged_diff_string)
  File "/Users/jess/.pyenv/versions/3.6.6/lib/python3.6/site-packages/unidiff/patch.py", line 438, in from_string
    return cls(cls._convert_string(data, encoding, errors))
  File "/Users/jess/.pyenv/versions/3.6.6/lib/python3.6/site-packages/unidiff/patch.py", line 353, in __init__
    self._parse(data, encoding=encoding)
  File "/Users/jess/.pyenv/versions/3.6.6/lib/python3.6/site-packages/unidiff/patch.py", line 406, in _parse
    raise UnidiffParseError('Unexpected marker: %s' % line)
unidiff.errors.UnidiffParseError: Unexpected marker: \ No newline at end of file

Solution for CI scanning

Only the staged added lines are scanned. When in a CI environment, there are no staged files. Add support for scanning diffs between two commits.

Improve README

The README.md is blank. It needs a Prerequisites, Installation, and Usage section

Union the secret specification files

git-secrets supports reading first from .gitsecrets and then, only if the first is not found, is ~/.gitsecrets looked at. Change this so both files are looked at and merged together.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.