Yelp / detect-secrets

An enterprise friendly way of detecting and preventing secrets in code.
Apache License 2.0
3.62k stars 450 forks source link

Avoid IndexError when passing an empty string to `is_prefixed_with_dollar_sign` #712

Closed sindrig closed 7 months ago

sindrig commented 10 months ago

As shown by the test, we want to return False for the empty string when checking if it is prefixed with a dollar.

The function is_prefixed_with_dollar_sign raises IndexError when called with the empty string.

is_prefixed_with_dollar_sign returns False for the empty string.

lorenzodb1 commented 8 months ago

@sindrig thank you for your contribution 😄 could you please merge master into your branch?

sindrig commented 8 months ago

@sindrig thank you for your contribution 😄 could you please merge master into your branch?

Done :heavy_check_mark:

lorenzodb1 commented 8 months ago

@sindrig thank you for that! Looks like one of the pre-commit checks is failing. Please, run make test and then push the changes

sindrig commented 8 months ago

@sindrig thank you for that! Looks like one of the pre-commit checks is failing. Please, run make test and then push the changes

Import order got mixed up. Fixed :white_check_mark:

lorenzodb1 commented 7 months ago

@sindrig Thank you for your contribution! I went ahead and merged your changes. Really appreciate your work and hope to see another PR of yours soon 😄