Skip to content

Commit f33653e

Browse files
committed
add ability to remove files matching names
1 parent 193cd23 commit f33653e

File tree

25 files changed

+400
-331
lines changed

25 files changed

+400
-331
lines changed

SCC-OUTPUT-REPORT.html

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
<tbody><tr>
1313
<th>Go</th>
1414
<th>36</th>
15-
<th>9162</th>
16-
<th>1456</th>
17-
<th>442</th>
18-
<th>7264</th>
19-
<th>1500</th>
20-
<th>370929</th>
15+
<th>9188</th>
16+
<th>1459</th>
17+
<th>443</th>
18+
<th>7286</th>
19+
<th>1506</th>
20+
<th>371497</th>
2121
</tr><tr>
2222
<th>Java</th>
2323
<th>24</th>
@@ -39,12 +39,12 @@
3939
</tr><tr>
4040
<th>Markdown</th>
4141
<th>11</th>
42-
<th>1369</th>
43-
<th>323</th>
42+
<th>1422</th>
43+
<th>337</th>
4444
<th>0</th>
45-
<th>1046</th>
45+
<th>1085</th>
4646
<th>0</th>
47-
<th>55837</th>
47+
<th>57744</th>
4848
</tr><tr>
4949
<th>Python</th>
5050
<th>10</th>
@@ -93,12 +93,12 @@
9393
</tr><tr>
9494
<th>Shell</th>
9595
<th>3</th>
96-
<th>1159</th>
97-
<th>154</th>
96+
<th>1163</th>
97+
<th>155</th>
9898
<th>91</th>
99-
<th>914</th>
99+
<th>917</th>
100100
<th>104</th>
101-
<th>41231</th>
101+
<th>41359</th>
102102
</tr><tr>
103103
<th>C#</th>
104104
<th>2</th>
@@ -413,7 +413,7 @@
413413
<th>0</th>
414414
<th>671</th>
415415
<th>0</th>
416-
<th>9794</th>
416+
<th>9795</th>
417417
</tr><tr>
418418
<th>JSON</th>
419419
<th>1</th>
@@ -661,11 +661,11 @@
661661
<tfoot><tr>
662662
<th>Total</th>
663663
<th>185</th>
664-
<th>29801</th>
665-
<th>3320</th>
666-
<th>1929</th>
667-
<th>24552</th>
668-
<th>2623</th>
669-
<th>1903918</th>
664+
<th>29884</th>
665+
<th>3338</th>
666+
<th>1930</th>
667+
<th>24616</th>
668+
<th>2629</th>
669+
<th>1906522</th>
670670
</tr></tfoot>
671671
</table></body></html>

main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ func main() {
121121
[]string{},
122122
"ignore file extensions (overrides include-ext) [comma separated list: e.g. go,java,js]",
123123
)
124+
flags.StringSliceVarP(
125+
&processor.ExcludeFilename,
126+
"exclude-file",
127+
"n",
128+
[]string{},
129+
"ignore files with matching names [comma separated list: e.g. main.go,_test.go]",
130+
)
124131
flags.BoolVarP(
125132
&processor.Languages,
126133
"languages",

processor/constants.go

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

processor/file.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,22 @@ func newFileJob(path, name string, fileInfo os.FileInfo) *FileJob {
280280
}
281281
}
282282

283+
if len(ExcludeFilename) != 0 {
284+
ok := true
285+
for _, x := range ExcludeFilename {
286+
if strings.Contains(name, x) {
287+
ok = false
288+
}
289+
}
290+
291+
if !ok {
292+
if Verbose {
293+
printWarn(fmt.Sprintf("skipping file as in exclude file list: %s", name))
294+
}
295+
return nil
296+
}
297+
}
298+
283299
for _, l := range language {
284300
LoadLanguageFeature(l)
285301
}

processor/processor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ var AllowListExtensions = []string{}
149149
// ExcludeListExtensions is a list of extensions which should be ignored
150150
var ExcludeListExtensions = []string{}
151151

152+
// ExcludeFilename is a list of filenames which should be ignored
153+
var ExcludeFilename = []string{}
154+
152155
// AverageWage is the average wage in dollars used for the COCOMO cost estimate
153156
var AverageWage int64 = 56286
154157

vendor/github.com/json-iterator/go/iter_float.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/modern-go/reflect2/reflect2.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/modern-go/reflect2/type_map.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/modern-go/reflect2/unsafe_link.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/spf13/pflag/flag.go

Lines changed: 16 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)