Skip to content

Commit

Permalink
Fixed build and linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
soumeh01 committed Jul 3, 2024
1 parent 6098914 commit 17c4e7b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/builder/csolution/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package csolution

import (
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -528,7 +527,7 @@ func TestIsProjectMoved(t *testing.T) {
_ = os.RemoveAll(tmpDirPath)
_ = os.MkdirAll(tmpDirPath, os.ModePerm)
cmakeCacheFile := filepath.Join(tmpDirPath, "CMakeCache.txt")
_ = ioutil.WriteFile(cmakeCacheFile, []byte(content), 0644)
_ = os.WriteFile(cmakeCacheFile, []byte(content), 0644)

Check failure on line 530 in pkg/builder/csolution/builder_test.go

View workflow job for this annotation

GitHub Actions / Lint

G306: Expect WriteFile permissions to be 0600 or less (gosec)
}

t.Run("test cache file not found", func(t *testing.T) {
Expand Down Expand Up @@ -594,7 +593,7 @@ func TestNeedRebuild(t *testing.T) {
_ = os.RemoveAll(tmpDir)
_ = os.MkdirAll(tmpDir, os.ModePerm)
cmakeCacheFile := filepath.Join(tmpDir, "CMakeCache.txt")
_ = ioutil.WriteFile(cmakeCacheFile, []byte(content), 0644)
_ = os.WriteFile(cmakeCacheFile, []byte(content), 0644)

Check failure on line 596 in pkg/builder/csolution/builder_test.go

View workflow job for this annotation

GitHub Actions / Lint

G306: Expect WriteFile permissions to be 0600 or less (gosec)

rebuild, err := b.needRebuild()
assert.Nil(err)
Expand All @@ -610,7 +609,7 @@ func TestNeedRebuild(t *testing.T) {
_ = os.RemoveAll(tmpDir)
_ = os.MkdirAll(tmpDir, os.ModePerm)
cmakeCacheFile := filepath.Join(tmpDir, "CMakeCache.txt")
_ = ioutil.WriteFile(cmakeCacheFile, []byte(content), 0644)
_ = os.WriteFile(cmakeCacheFile, []byte(content), 0644)

Check failure on line 612 in pkg/builder/csolution/builder_test.go

View workflow job for this annotation

GitHub Actions / Lint

G306: Expect WriteFile permissions to be 0600 or less (gosec)

rebuild, err := b.needRebuild()
assert.Nil(err)
Expand Down
23 changes: 23 additions & 0 deletions test/data/Rebuild.cbuild-idx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
build-idx:
generated-by: csolution 1.4.0
cdefault: HelloWorld.cdefault.yml
csolution: HelloWorld.csolution.yml
cprojects:
- cproject: cm0plus/HelloWorld_cm0plus.cproject.yml
- cproject: cm4/HelloWorld_cm4.cproject.yml
licenses: test123
cbuilds:
- cbuild: cm0plus/HelloWorld_cm0plus.Debug+FRDM-K32L3A6.cbuild.yml
project: HelloWorld_cm0plus
configuration: .Debug+FRDM-K32L3A6
rebuild: true
- cbuild: cm0plus/HelloWorld_cm0plus.Release+FRDM-K32L3A6.cbuild.yml
project: HelloWorld_cm0plus
configuration: .Release+FRDM-K32L3A6
- cbuild: cm4/HelloWorld_cm4.Debug+FRDM-K32L3A6.cbuild.yml
project: HelloWorld_cm4
configuration: .Debug+FRDM-K32L3A6
- cbuild: cm4/HelloWorld_cm4.Release+FRDM-K32L3A6.cbuild.yml
project: HelloWorld_cm4
configuration: .Release+FRDM-K32L3A6
rebuild: true

0 comments on commit 17c4e7b

Please sign in to comment.