mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
feat(allowlist): promote optimizations (#1908)
This commit is contained in:
1 parent
7fb4eda723
commit
bd79c3eaca
4 files changed
+20
-49
No files matched your search
+1
-6
@@ -77,7 +77,6 @@ func init() {
|
||||
rootCmd.PersistentFlags().StringP("gitleaks-ignore-path", "i", ".", "path to .gitleaksignore file or folder containing one")
|
||||
rootCmd.PersistentFlags().Int("max-decode-depth", 0, "allow recursive decoding up to this depth (default \"0\", no decoding is done)")
|
||||
rootCmd.PersistentFlags().Int("max-archive-depth", 0, "allow scanning into nested archives up to this depth (default \"0\", no archive traversal is done)")
|
||||
rootCmd.PersistentFlags().BoolP("experimental-optimizations", "", false, "enables experimental allowlist optimizations, increasing performance at the cost of startup time")
|
||||
|
||||
// Add diagnostics flags
|
||||
rootCmd.PersistentFlags().String("diagnostics", "", "enable diagnostics (http OR comma-separated list: cpu,mem,trace). cpu=CPU prof, mem=memory prof, trace=exec tracing, http=serve via net/http/pprof")
|
||||
@@ -223,11 +222,7 @@ func Config(cmd *cobra.Command) config.Config {
|
||||
if err := viper.Unmarshal(&vc); err != nil {
|
||||
logging.Fatal().Err(err).Msg("Failed to load config")
|
||||
}
|
||||
// set experimental feature flag(s)
|
||||
if mustGetBoolFlag(cmd, "experimental-optimizations") {
|
||||
logging.Warn().Msgf("using experimental allowlist optimizations, updates may contain breaking changes!")
|
||||
vc.EnableExperimentalAllowlistOptimizations = true
|
||||
}
|
||||
|
||||
cfg, err := vc.Translate()
|
||||
if err != nil {
|
||||
logging.Fatal().Err(err).Msg("Failed to load config")
|
||||
|
||||
Reference in new issue
Block a user