Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrav committed Jan 30, 2024
2 parents da07843 + 1699097 commit 592d4e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions pkg/gitparse/gitparse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,9 @@ Author: Zachary Rice <[email protected]>
Date: Tue Jun 13 14:49:21 2023 -0500
add a custom detector check for logging duplicate detector (#1394)
* add a custom detector check for logging duplicate detector
* use pb type
diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go
Expand Down Expand Up @@ -627,7 +627,7 @@ Author: Michelle Purcell <[email protected]>
Date: Tue Jun 27 13:48:04 2023 +0100
Update docs/src/main/asciidoc/security-vulnerability-detection.adoc
Co-authored-by: Sergey Beryozkin <[email protected]>
(cherry picked from commit 10f04b79e0ab3a331ac1bfae78d7ed399e243bf0)
Expand Down Expand Up @@ -1223,12 +1223,12 @@ index 239b415..2ee133b 100644
+++ b/aws2
!!!ERROR!!!
blah blaj
-this is the secret: AKIA2E0A8F3B244C9986
+this is the secret: [Default]
+Access key Id: AKIAILE3JG6KMS3HZGCA
+Secret Access Key: 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
-okay thank you bye
\ No newline at end of file
+okay thank you bye
Expand Down Expand Up @@ -1308,7 +1308,7 @@ func TestMaxDiffSize(t *testing.T) {
select {
case commit := <-commitChan:
if commit.Diffs[0].Len(ctx) > parser.maxDiffSize+1024 {
t.Errorf("diff did not match MaxDiffSize. Got: %d, expected (max): %d", commit.Diffs[0].Len(), parser.maxDiffSize+1024)
t.Errorf("diff did not match MaxDiffSize. Got: %d, expected (max): %d", commit.Diffs[0].Len(ctx), parser.maxDiffSize+1024)
}
case <-ctx.Done():
t.Fatal("Test timed out")
Expand Down Expand Up @@ -1620,7 +1620,7 @@ Author: rjtmahinay <[email protected]>
Date: Mon Jul 10 01:22:32 2023 +0800
Add QuarkusApplication javadoc
* Fix #34463
diff --git a/core/runtime/src/main/java/io/quarkus/runtime/QuarkusApplication.java b/core/runtime/src/main/java/io/quarkus/runtime/QuarkusApplication.java
Expand Down Expand Up @@ -2081,12 +2081,12 @@ index 239b415..2ee133b 100644
+++ b/aws2
@@ -1,5 +1,7 @@
blah blaj
-this is the secret: AKIA2E0A8F3B244C9986
+this is the secret: [Default]
+Access key Id: AKIAILE3JG6KMS3HZGCA
+Secret Access Key: 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
-okay thank you bye
\ No newline at end of file
+okay thank you bye
Expand Down Expand Up @@ -2212,12 +2212,12 @@ index 239b415..2ee133b 100644
+++ b/aws
@@ -1,5 +1,7 @@
blah blaj
-this is the secret: AKIA2E0A8F3B244C9986
+this is the secret: [Default]
+Access key Id: AKIAILE3JG6KMS3HZGCA
+Secret Access Key: 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
-okay thank you bye
\ No newline at end of file
+okay thank you bye
Expand Down
6 changes: 3 additions & 3 deletions pkg/sources/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ func (s *Git) ScanCommits(ctx context.Context, repo *git.Repository, path string
continue
}

if diff.Len() > sources.ChunkSize+sources.PeekSize {
if diff.Len(ctx) > sources.ChunkSize+sources.PeekSize {
s.gitChunk(ctx, &diff, fileName, email, hash, when, remoteURL, reporter)
continue
}
Expand All @@ -597,7 +597,7 @@ func (s *Git) ScanCommits(ctx context.Context, repo *git.Repository, path string
}
defer reader.Close()

data := make([]byte, diff.Len())
data := make([]byte, diff.Len(ctx))
if _, err := reader.Read(data); err != nil {
ctx.Logger().Error(err, "error reading diff content for commit", "filename", fileName, "commit", hash, "file", diff.PathB)
return nil
Expand Down Expand Up @@ -781,7 +781,7 @@ func (s *Git) ScanStaged(ctx context.Context, repo *git.Repository, path string,
}
defer reader.Close()

data := make([]byte, diff.Len())
data := make([]byte, diff.Len(ctx))
if _, err := reader.Read(data); err != nil {
ctx.Logger().Error(err, "error reading diff content for staged", "filename", fileName, "commit", hash, "file", diff.PathB)
return nil
Expand Down

0 comments on commit 592d4e8

Please sign in to comment.