Skip to content

Commit

Permalink
Fixes lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
filip-debricked committed Aug 26, 2024
1 parent 0dfbe6c commit e0f797c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion internal/callgraph/language/java11/strategy.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func NewStrategy(config conf.IConfig, paths []string, exclusions []string, inclu
}

func strategyWarning(errMsg string) {
err := fmt.Errorf(errMsg)
err := fmt.Errorf("%s", errMsg)
warningColor := color.New(color.FgYellow, color.Bold).SprintFunc()
defaultOutputWriter := log.Writer()
log.Println(warningColor("Warning: ") + err.Error())
Expand Down
6 changes: 0 additions & 6 deletions internal/file/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ func isCompressed(filename string) bool {
return compressed
}

func (finder *Finder) getWorkspaces(options DebrickedOptions) ([]string, error) {
var workspaces []string

return workspaces, nil
}

func (finder *Finder) GetIncludedGroups(formats []*CompiledFormat, options DebrickedOptions) (Groups, error) {
// NOTE: inefficient because it walks into excluded directories
var groups Groups
Expand Down
8 changes: 2 additions & 6 deletions internal/file/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (gs *Groups) GetFiles() []string {
return files
}

func (gs *Groups) matchWorkspace(workspaceManifest WorkspaceManifest) error {
func (gs *Groups) matchWorkspace(workspaceManifest WorkspaceManifest) {
for _, g := range gs.groups {
// If group g is missing lockfile and does not have the same manifest
if len(g.LockFiles) == 0 && g.ManifestFile != workspaceManifest.RootManifest {
Expand All @@ -126,10 +126,9 @@ func (gs *Groups) matchWorkspace(workspaceManifest WorkspaceManifest) error {
}
}
}
return nil
}

func (gs *Groups) AddWorkspaceLockFiles() error {
func (gs *Groups) AddWorkspaceLockFiles() {
for _, group := range gs.groups {
workspaces, err := getWorkspaces(group.ManifestFile)
if err == nil && group.HasLockFiles() {
Expand All @@ -139,9 +138,6 @@ func (gs *Groups) AddWorkspaceLockFiles() error {
Workspaces: workspaces,
}
gs.matchWorkspace(workspaceManifest)

}
}
return nil

}
6 changes: 2 additions & 4 deletions internal/file/groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ func TestGroupsMatchWorkspaces(t *testing.T) {
RootManifest: "package.json",
Workspaces: []string{"package/*"},
}
err := gs.matchWorkspace(workspaceManifest)
assert.NoError(t, err)
gs.matchWorkspace(workspaceManifest)
for _, g := range gs.groups {
if g.ManifestFile == "package/file3" {
assert.Equal(t, g.LockFiles[0], g1.LockFiles[0])
Expand All @@ -224,8 +223,7 @@ func TestAddWorkspaceLockFiles(t *testing.T) {
gs.Add(*g1)
gs.Add(*g2)
gs.Add(*g3)
err := gs.AddWorkspaceLockFiles()
assert.NoError(t, err)
gs.AddWorkspaceLockFiles()
for _, g := range gs.groups {
assert.Equal(t, len(g.LockFiles), 1)
if len(g.LockFiles) == 1 {
Expand Down
2 changes: 1 addition & 1 deletion internal/fingerprint/fingerprint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var errorString = "mock error"

// Test errors in symlink
func mockSymlink(filename string) (bool, error) {
return false, fmt.Errorf(errorString)
return false, fmt.Errorf("%s", errorString)
}
func TestShouldProcessFile(t *testing.T) {
// Create a temporary directory to use for testing
Expand Down

0 comments on commit e0f797c

Please sign in to comment.