Parcourir la source

Fix typos in *.md, comments and logs (#1185)

Oleksandr Redko il y a 2 ans
Parent
commit
6705461b33
7 fichiers modifiés avec 8 ajouts et 8 suppressions
  1. 1 1
      CONTRIBUTING.md
  2. 1 1
      README.md
  3. 2 2
      cmd/generate/config/rules/telegram.go
  4. 1 1
      detect/baseline.go
  5. 1 1
      detect/detect_test.go
  6. 1 1
      detect/utils.go
  7. 1 1
      report/finding.go

+ 1 - 1
CONTRIBUTING.md

@@ -78,7 +78,7 @@ If you want to add a new rule to the [default Gitleaks configuration](https://gi
    token that is unique enough not to require an identifier then you can use
    token that is unique enough not to require an identifier then you can use
    this function. For example, Pulumi's API Token has the prefix `pul-` which is
    this function. For example, Pulumi's API Token has the prefix `pul-` which is
    unique enough to use `generateUniqueToken`. But something like Beamer's API
    unique enough to use `generateUniqueToken`. But something like Beamer's API
-   token that has a `b_` prefix is not unqiue enough to use `generateUniqueToken`,
+   token that has a `b_` prefix is not unique enough to use `generateUniqueToken`,
    so instead we use `generateSemiGenericRegex` and require a `beamer`
    so instead we use `generateSemiGenericRegex` and require a `beamer`
    identifier is part of the rule.
    identifier is part of the rule.
    If a token's prefix has more than `3` characters then you could
    If a token's prefix has more than `3` characters then you could

+ 1 - 1
README.md

@@ -272,7 +272,7 @@ Gitleaks offers a configuration format you can follow to write your own secret d
 title = "Gitleaks title"
 title = "Gitleaks title"
 
 
 # Extend the base (this) configuration. When you extend a configuration
 # Extend the base (this) configuration. When you extend a configuration
-# the base rules take precendence over the extended rules. I.e, if there are
+# the base rules take precedence over the extended rules. I.e., if there are
 # duplicate rules in both the base configuration and the extended configuration
 # duplicate rules in both the base configuration and the extended configuration
 # the base rules will override the extended rules.
 # the base rules will override the extended rules.
 # Another thing to know with extending configurations is you can chain together
 # Another thing to know with extending configurations is you can chain together

+ 2 - 2
cmd/generate/config/rules/telegram.go

@@ -28,9 +28,9 @@ func TelegramBotToken() *config.Rule {
 	minToken := secrets.NewSecret(numeric("5") + ":A" + alphaNumericExtendedShort("34"))
 	minToken := secrets.NewSecret(numeric("5") + ":A" + alphaNumericExtendedShort("34"))
 	maxToken := secrets.NewSecret(numeric("16") + ":A" + alphaNumericExtendedShort("34"))
 	maxToken := secrets.NewSecret(numeric("16") + ":A" + alphaNumericExtendedShort("34"))
 	tps := []string{
 	tps := []string{
-		// variable assigment
+		// variable assignment
 		generateSampleSecret("telegram", validToken),
 		generateSampleSecret("telegram", validToken),
-		// URL contaning token
+		// URL containing token
 		generateSampleSecret("url", "https://api.telegram.org/bot"+validToken+"/sendMessage"),
 		generateSampleSecret("url", "https://api.telegram.org/bot"+validToken+"/sendMessage"),
 		// object constructor
 		// object constructor
 		`const bot = new Telegraf("` + validToken + `")`,
 		`const bot = new Telegraf("` + validToken + `")`,

+ 1 - 1
detect/baseline.go

@@ -13,7 +13,7 @@ import (
 
 
 func IsNew(finding report.Finding, baseline []report.Finding) bool {
 func IsNew(finding report.Finding, baseline []report.Finding) bool {
 	// Explicitly testing each property as it gives significantly better performance in comparison to cmp.Equal(). Drawback is that
 	// Explicitly testing each property as it gives significantly better performance in comparison to cmp.Equal(). Drawback is that
-	// the code requires maintanance if/when the Finding struct changes
+	// the code requires maintenance if/when the Finding struct changes
 	for _, b := range baseline {
 	for _, b := range baseline {
 
 
 		if finding.Author == b.Author &&
 		if finding.Author == b.Author &&

+ 1 - 1
detect/detect_test.go

@@ -23,7 +23,7 @@ func TestDetect(t *testing.T) {
 		fragment     Fragment
 		fragment     Fragment
 		// NOTE: for expected findings, all line numbers will be 0
 		// NOTE: for expected findings, all line numbers will be 0
 		// because line deltas are added _after_ the finding is created.
 		// because line deltas are added _after_ the finding is created.
-		// I.e, if the finding is from a --no-git file, the line number will be
+		// I.e., if the finding is from a --no-git file, the line number will be
 		// increase by 1 in DetectFromFiles(). If the finding is from git,
 		// increase by 1 in DetectFromFiles(). If the finding is from git,
 		// the line number will be increased by the patch delta.
 		// the line number will be increased by the patch delta.
 		expectedFindings []report.Finding
 		expectedFindings []report.Finding

+ 1 - 1
detect/utils.go

@@ -74,7 +74,7 @@ func filter(findings []report.Finding, redact bool) []report.Finding {
 
 
 					genericMatch := strings.Replace(f.Match, f.Secret, "REDACTED", -1)
 					genericMatch := strings.Replace(f.Match, f.Secret, "REDACTED", -1)
 					betterMatch := strings.Replace(fPrime.Match, fPrime.Secret, "REDACTED", -1)
 					betterMatch := strings.Replace(fPrime.Match, fPrime.Secret, "REDACTED", -1)
-					log.Trace().Msgf("skipping %s finding (%s), %s rule takes precendence (%s)", f.RuleID, genericMatch, fPrime.RuleID, betterMatch)
+					log.Trace().Msgf("skipping %s finding (%s), %s rule takes precedence (%s)", f.RuleID, genericMatch, fPrime.RuleID, betterMatch)
 					include = false
 					include = false
 					break
 					break
 				}
 				}

+ 1 - 1
report/finding.go

@@ -38,7 +38,7 @@ type Finding struct {
 	// Rule is the name of the rule that was matched
 	// Rule is the name of the rule that was matched
 	RuleID string
 	RuleID string
 
 
-	// unique identifer
+	// unique identifier
 	Fingerprint string
 	Fingerprint string
 }
 }