Skip to content

Conversation

@whutomo
Copy link
Contributor

@whutomo whutomo commented Sep 6, 2022

I have added .pre-commit-config.yaml file which performs a pre-commit hook to perform detect-secrets .This will prevent from developers to accidentally committing code changes with potential secrets in it

Please run brew install detect-secrets and brew install pre-commit to enable the the pre-commit hook operation in your local machine.

if you have issues with installing the dependencies above please find more information here:

to test it out after installation, perform the following:

  • you either can edit an existing file or create a new one and add a new line (e.g. const password = 1234)
  • stage the change
  • try to commit the change
  • you should be seeing errors
    image

@whutomo whutomo requested a review from a team as a code owner September 6, 2022 06:19
@rifont
Copy link
Contributor

rifont commented Sep 6, 2022

Hey @whutomo, is it possible to use the pre-commit NPM package, to keep installations purely to NPM? This will also add support for Windows devices which won't have brew available.

@whutomo
Copy link
Contributor Author

whutomo commented Sep 7, 2022

Hey @whutomo, is it possible to use the pre-commit NPM package, to keep installations purely to NPM? This will also add support for Windows devices which won't have brew available.

Hi @richardfontein, I have tried to be using the npm version of detect-secrets but it does not run at all. I also notice that the npm package isn't well maintained lirantal/detect-secrets#11. This could be the reason why.

Although windows does not support brew, these packages (detect-secrets & pre-commit) are available via pip too.

if supporting window OS is a priority for us I am happy to take another look at different libraries like https://www.npmjs.com/package/truffle-security

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants