1
0
mirror of https://github.com/securego/gosec.git synced 2025-11-29 22:37:59 +02:00

Configuration

This re-works the way that CLI options are passed through to the
analyzer so that they can act as overrides for config options. If
not given on the CLI, options will come from a config file. If no
file is used then a default value is chosen.

Two lists are also populated with tests to include or exclude.
These lists are not used for now but will eventually replace the
way we select test to run in a future patch to follow.
This commit is contained in:
Tim Kelsey
2016-08-05 14:27:21 +01:00
parent 4e30ca3866
commit e3b1d33b95
17 changed files with 154 additions and 53 deletions

View File

@@ -21,7 +21,8 @@ import (
)
func TestChmod(t *testing.T) {
analyzer := gas.NewAnalyzer(false, nil, nil)
config := map[string]interface{}{"ignoreNosec": false}
analyzer := gas.NewAnalyzer(config, nil)
analyzer.AddRule(NewChmodPerms())
issues := gasTestRunner(`
@@ -36,7 +37,8 @@ func TestChmod(t *testing.T) {
}
func TestMkdir(t *testing.T) {
analyzer := gas.NewAnalyzer(false, nil, nil)
config := map[string]interface{}{"ignoreNosec": false}
analyzer := gas.NewAnalyzer(config, nil)
analyzer.AddRule(NewMkdirPerms())
issues := gasTestRunner(`