GitGuardian / ggshield

Find and fix 400+ types of hardcoded secrets and 70+ types of infrastructure-as-code misconfigurations.
https://gitguardian.com
MIT License
1.65k stars 147 forks source link

Deprecate dash-separated config keys #870

Closed agateau-gg closed 5 months ago

agateau-gg commented 6 months ago

Context

This PR makes deprecate dash-separated config keys and suggest using underscore-separate keys instead. This means one must use show_secrets and not show-secrets.

Using dash syntax still works but ggshield prints a warning message when it finds them and no longer makes any effort to refer to a key in the syntax it was written.

Output

Here is what the output looks like with a dash-separated key in the "global" config and 3 other dash-separated keys in the current directory (~/src/ggshield-alt in my example):

$ ggshield api-status
/home/agateau/.gitguardian.yaml: Config key show-secrets is deprecated, use show_secrets instead.
/home/agateau/src/ggshield-alt/.gitguardian.yaml: Config key ignored-matches is deprecated, use ignored_matches instead.
/home/agateau/src/ggshield-alt/.gitguardian.yaml: Config key ignored-paths is deprecated, use ignored_paths instead.
/home/agateau/src/ggshield-alt/.gitguardian.yaml: Config key ignored-policies is deprecated, use ignored_policies instead.
API URL: https://api.gitguardian.com
Status: healthy
App version: v2.62.1
Secrets engine version: 2.109.0

Review

Best reviewed commit by commit.

codecov-commenter commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.66%. Comparing base (372be8a) to head (a59330f). Report is 3 commits behind head on main.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #870 +/- ## ========================================== - Coverage 91.67% 91.66% -0.01% ========================================== Files 170 170 Lines 7060 7065 +5 ========================================== + Hits 6472 6476 +4 - Misses 588 589 +1 ``` | [Flag](https://app.codecov.io/gh/GitGuardian/ggshield/pull/870/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GitGuardian) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/GitGuardian/ggshield/pull/870/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GitGuardian) | `91.66% <100.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GitGuardian#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

GG-HH commented 5 months ago

Hello @agateau-gg , should we modify the .gitguardian.example.yaml too ?

agateau-gg commented 5 months ago

Hello @agateau-gg , should we modify the .gitguardian.example.yaml too ?

Good point! Just fixed it, and found a few other places to fix while checking.