Skip to content

Commit 0c82b64

Browse files
committed
return gosec default excludes: it's too annoying for users
1 parent dbfcf63 commit 0c82b64

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,21 @@ Flags:
369369
370370
# megacheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore
371371
- ineffective break statement. Did you mean to break out of the outer loop
372+
373+
# gas: Too many false-positives on 'unsafe' usage
374+
- Use of unsafe calls should be audited
375+
376+
# gas: Too many false-positives for parametrized shell calls
377+
- Subprocess launch(ed with variable|ing should be audited)
378+
379+
# gas: Duplicated errcheck checks
380+
- G104
381+
382+
# gas: Too many issues in popular repos
383+
- (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
384+
385+
# gas: False positive is triggered by 'src, err := ioutil.ReadFile(filename)'
386+
- Potential file inclusion via variable
372387
(default true)
373388
--max-issues-per-linter int Maximum issues count per one linter. Set to 0 to disable (default 50)
374389
--max-same-issues int Maximum count of issues with the same text. Set to 0 to disable (default 3)

pkg/config/config.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,31 @@ var DefaultExcludePatterns = []ExcludePattern{
5454
Linter: "megacheck",
5555
Why: "Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore",
5656
},
57+
{
58+
Pattern: "Use of unsafe calls should be audited",
59+
Linter: "gas",
60+
Why: "Too many false-positives on 'unsafe' usage",
61+
},
62+
{
63+
Pattern: "Subprocess launch(ed with variable|ing should be audited)",
64+
Linter: "gas",
65+
Why: "Too many false-positives for parametrized shell calls",
66+
},
67+
{
68+
Pattern: "G104",
69+
Linter: "gas",
70+
Why: "Duplicated errcheck checks",
71+
},
72+
{
73+
Pattern: "(Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)",
74+
Linter: "gas",
75+
Why: "Too many issues in popular repos",
76+
},
77+
{
78+
Pattern: "Potential file inclusion via variable",
79+
Linter: "gas",
80+
Why: "False positive is triggered by 'src, err := ioutil.ReadFile(filename)'",
81+
},
5782
}
5883

5984
func GetDefaultExcludePatternsStrings() []string {

0 commit comments

Comments
 (0)