Skip to content

Commit

Permalink
analyzer: update for custom order (#91)
Browse files Browse the repository at this point in the history
Signed-off-by: Loong <loong.dai@intel.com>
  • Loading branch information
daixiang0 authored Aug 1, 2022
1 parent c32c832 commit a188fbc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ func generateCmdLine(cfg config.Config) string {
result += " --skip-generated "
}

if cfg.BoolConfig.CustomOrder {
result += " --custom-order "
}

for _, s := range cfg.Sections.String() {
result += fmt.Sprintf(" --Section \"%s\" ", s)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import (
"github.com/stretchr/testify/assert"
)

func TestErrorMatching(t *testing.T) {
func TestInvalidNumberOfFiles(t *testing.T) {
assert.True(t, errors.Is(InvalidNumberOfFilesInAnalysis{1, 2}, InvalidNumberOfFilesInAnalysis{}))
}
1 change: 1 addition & 0 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ func TestInitGciConfigFromYAML(t *testing.T) {
assert.Equal(t, section.SectionList{section.Default{}}, gciCfg.Sections)
assert.False(t, gciCfg.Debug)
assert.True(t, gciCfg.SkipGenerated)
assert.False(t, gciCfg.CustomOrder)
}

0 comments on commit a188fbc

Please sign in to comment.