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

Custom inline allowlisting comment

Open TommasoLencioni opened this issue 2 years ago • 1 comments

  • I'm submitting a ...

    • [ ] bug report
    • [x] feature request
  • What is the current behavior? Only the lines commented with # pragma: allowlist secret and the lines containing one of the DENYLIST stings are ignored.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  • What is the expected behavior? I would like to specify the inline allowlisting comment format (e.g. # detect-secrets: ignore instead of # pragma: allowlist secret).

  • What is the motivation / use case for changing the behavior? The custom allowlist comment is more clear for future code maintenance.

  • Please tell us about your environment:

    • detect-secrets Version: 1.4.0
    • Python Version: 3.10
    • OS Version:
    • File type (if applicable):
  • Other information

TommasoLencioni avatar Mar 29 '23 12:03 TommasoLencioni

Ciao @TommasoLencioni e grazie per l'issue aperta!

and the lines containing one of the DENYLIST stings are ignored

Fyi le righe di codice che contengono le strings in DENYLIST non vengono ignorate ma vengono segnalate (probabilmente era solo un lapsus, ma vale la pena chiarire).

Detto questo, l'utilizzo di commenti stile # pragma per definire un command da eseguire è una cosa abbastanza standard. Per capire l'use-case, il tuo è un problema del tipo che hai diverse librerie che usano commenti simili per cui si possono confondere o possono overlap oppure è più un discorso di rendere immediatamente chiaro che quel commento è legato a detect-secrets?

P.S. mi scuso se ho risposto in italiano ma mi capita raramente di parlarlo in questi contesti per cui se posso ne approfitto 😅

P.S. x2 curiosità personale: a PagoPA usano detect-secrets? Chiedo perché ho notato che lavori là.

lorenzodb1 avatar Apr 01 '23 00:04 lorenzodb1

We're going to close this issue as it hasn't received any update in a very long time. Feel free to re-open it if you think it's still relevant.

lorenzodb1 avatar May 16 '24 17:05 lorenzodb1