File tree Expand file tree Collapse file tree 5 files changed +26
-10
lines changed Expand file tree Collapse file tree 5 files changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,20 @@ Check the entire history of the current branch for secrets.
17
17
18
18
```
19
19
$ git log -p | scanrepo
20
+
21
+ ------------------
22
+ Violation 1
23
+ Commit: 4cc087a1b4731d1017844cc86323df43068b0409
24
+ File: web/src/db/seed.sql
25
+ Reason: "SQL dump file"
26
+
27
+ ------------------
28
+ Violation 2
29
+ Commit: 142e6019248c0d53a5240242ed1a75c0cc110a0b
30
+ File: config/passwords.ini
31
+ Reason: "Contains word: password"
32
+
33
+ ...
20
34
```
21
35
22
36
-----------------------------------------------------------
Original file line number Diff line number Diff line change 1
- - [ ] type [ ] Stats == logger = strings.Stringer() interface -> for creating string for email
2
- - [ ] Add email notifications (+ interface + tests)
3
-
4
-
5
- - [ ] Enable analysis of private github repos (authenticate using integration ID + private key - add to secrets)
6
-
1
+ ### bufio.NewScanner Limitations
2
+ ```
3
+ // Programs that need more control over error handling or large tokens,
4
+ // or must run sequential scans on a reader, should use bufio.Reader instead.
5
+ ```
7
6
7
+ ### TODO
8
8
- [ ] Analyze body of commits (added/removed lines)
9
-
10
-
11
9
- [ ] Add concurrency (parallelize requests to github API)
12
10
- [ ] Add context + timeout to requests to github API
Original file line number Diff line number Diff line change @@ -54,9 +54,13 @@ func main() {
54
54
55
55
i := 1
56
56
fmt .Fprintf (os .Stderr , "Diff contains %d offenses\n \n " , matches )
57
- for filename , rule := range res .MatchedRules {
57
+ for diffKey , rule := range res .MatchedRules {
58
58
fmt .Fprintf (os .Stderr , "------------------\n " )
59
59
fmt .Fprintf (os .Stderr , "Violation %d\n " , i )
60
+ commit , filename := diffence .SplitDiffHashKey (diffKey )
61
+ if commit != "" {
62
+ fmt .Fprintf (os .Stderr , "Commit: %s\n " , commit )
63
+ }
60
64
fmt .Fprintf (os .Stderr , "File: %s\n " , filename )
61
65
fmt .Fprintf (os .Stderr , "Reason: %#v\n \n " , rule [0 ].Caption )
62
66
i ++
Original file line number Diff line number Diff line change 1
- RELEASE_VERSION=0.3.1
1
+ RELEASE_VERSION=0.4.0
2
2
RELEASE_BUILD_PATH=./cmd/scanrepo
You can’t perform that action at this time.
0 commit comments