Skip to content

Bump github.com/arduino/go-paths-helper from 1.11.0 to 1.12.0 #685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: github.com/arduino/go-paths-helper
version: v1.11.0
version: v1.12.0
type: go
summary:
homepage: https://pkg.go.dev/github.com/arduino/go-paths-helper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: github.com/arduino/go-paths-helper
version: v1.11.0
version: v1.12.0
type: go
summary:
homepage: https://pkg.go.dev/github.com/arduino/go-paths-helper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: github.com/arduino/go-paths-helper
version: v1.11.0
version: v1.12.0
type: go
summary:
homepage: https://pkg.go.dev/github.com/arduino/go-paths-helper
Expand Down
2 changes: 1 addition & 1 deletion docsgen/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/arduino/arduino-cli v0.0.0-20201210103408-bf7a3194bb63 // indirect
github.com/arduino/go-paths-helper v1.11.0 // indirect
github.com/arduino/go-paths-helper v1.12.0 // indirect
github.com/arduino/go-properties-orderedmap v1.8.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/client9/misspell v0.3.4 // indirect
Expand Down
4 changes: 2 additions & 2 deletions docsgen/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ github.com/arduino/board-discovery v0.0.0-20180823133458-1ba29327fb0c/go.mod h1:
github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
github.com/arduino/go-paths-helper v1.3.2/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
github.com/arduino/go-paths-helper v1.11.0 h1:hkpGb9AtCTByTj2FKutuHWb3klDf4kAKL10hW+fN+oE=
github.com/arduino/go-paths-helper v1.11.0/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM=
github.com/arduino/go-paths-helper v1.12.0 h1:xizOQtI9iHdl19qXd1EmWg5i9W//2bOCOYwlNv8F61E=
github.com/arduino/go-paths-helper v1.12.0/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM=
github.com/arduino/go-properties-orderedmap v1.3.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
github.com/arduino/go-properties-orderedmap v1.8.0 h1:wEfa6hHdpezrVOh787OmClsf/Kd8qB+zE3P2Xbrn0CQ=
github.com/arduino/go-properties-orderedmap v1.8.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ replace github.com/oleiade/reflections => github.com/oleiade/reflections v1.0.1

require (
github.com/arduino/arduino-cli v0.0.0-20201210103408-bf7a3194bb63
github.com/arduino/go-paths-helper v1.11.0
github.com/arduino/go-paths-helper v1.12.0
github.com/arduino/go-properties-orderedmap v1.8.0
github.com/client9/misspell v0.3.4
github.com/go-git/go-git/v5 v5.7.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ github.com/arduino/board-discovery v0.0.0-20180823133458-1ba29327fb0c/go.mod h1:
github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
github.com/arduino/go-paths-helper v1.3.2/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
github.com/arduino/go-paths-helper v1.11.0 h1:hkpGb9AtCTByTj2FKutuHWb3klDf4kAKL10hW+fN+oE=
github.com/arduino/go-paths-helper v1.11.0/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM=
github.com/arduino/go-paths-helper v1.12.0 h1:xizOQtI9iHdl19qXd1EmWg5i9W//2bOCOYwlNv8F61E=
github.com/arduino/go-paths-helper v1.12.0/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM=
github.com/arduino/go-properties-orderedmap v1.3.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
github.com/arduino/go-properties-orderedmap v1.8.0 h1:wEfa6hHdpezrVOh787OmClsf/Kd8qB+zE3P2Xbrn0CQ=
github.com/arduino/go-properties-orderedmap v1.8.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
Expand Down
2 changes: 1 addition & 1 deletion internal/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func findProjectsUnderPath(targetPath *paths.Path, projectTypeFilter projecttype
// It is possible for a combination of symlinks to parent paths to cause project discovery to get stuck in
// an endless loop of recursion. This is avoided by keeping count of the depth of symlinks and discontinuing
// recursion when it exceeds reason.
pathStat, err := os.Lstat(potentialProjectDirectory.String())
pathStat, err := potentialProjectDirectory.Lstat()
if err != nil {
panic(err)
}
Expand Down
51 changes: 51 additions & 0 deletions internal/project/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,57 @@ func TestSymlinkLoop(t *testing.T) {
assert.Panics(t, func() { FindProjects() }, "Infinite symlink loop encountered during project discovery")
}

func TestBrokenSymlink(t *testing.T) {
projectsPath := testDataPath.Join("Projects")
symlinkPath := projectsPath.Join("test-symlink")
symlinkTargetPath := projectsPath.Join("nonexistent")
// The broken symlink must have the attributes of a folder in order to be effective in this test, so the target must
// exist at the time the symlink is created.
err := symlinkTargetPath.Mkdir()
require.Nil(t, err)
// Create a folder symlink in the projects folder.
// It's probably most friendly to developers using Windows to create the symlink needed for the test on demand.
err = os.Symlink(projectsPath.Join("nonexistent").String(), symlinkPath.String())
require.Nil(t, err, "This test must be run as administrator on Windows to have symlink creation privilege.")
defer symlinkPath.RemoveAll() // Clean up.

// Break the symlink.
err = symlinkTargetPath.Remove()
require.Nil(t, err)

flags := test.ConfigurationFlags()
flags.Set("project-type", "all")
flags.Set("recursive", "true")
configuration.Initialize(flags, []string{projectsPath.String()})

foundProjects, err := FindProjects()
require.Nil(t, err)
assert.True(
t,
reflect.DeepEqual(
foundProjects,
[]Type{
{
Path: testDataPath.Join("Projects", "Library"),
ProjectType: projecttype.Library,
SuperprojectType: projecttype.Library,
},
{
Path: testDataPath.Join("Projects", "Library", "examples", "Example"),
ProjectType: projecttype.Sketch,
SuperprojectType: projecttype.Library,
},
{
Path: testDataPath.Join("Projects", "Sketch"),
ProjectType: projecttype.Sketch,
SuperprojectType: projecttype.Sketch,
},
},
),
"Broken symlink encountered during project discovery",
)
}

func TestFindProjects(t *testing.T) {
sketchPath := testDataPath.Join("Sketch")
libraryPath := testDataPath.Join("Library")
Expand Down
2 changes: 1 addition & 1 deletion internal/rule/rulefunction/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func LibraryContainsSymlinks() (result ruleresult.Type, output string) {

symlinkPaths := []string{}
for _, projectPathItem := range projectPathListing {
projectPathItemStat, err := os.Lstat(projectPathItem.String())
projectPathItemStat, err := projectPathItem.Lstat()
if err != nil {
panic(err)
}
Expand Down
13 changes: 13 additions & 0 deletions internal/rule/rulefunction/library_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@ func TestLibraryContainsSymlinks(t *testing.T) {
err = symlinkPath.RemoveAll()
require.Nil(t, err)

// Set up a library with a broken symlink.
err = os.Symlink(librariesTestDataPath.Join(testLibrary, "nonexistent").String(), symlinkPath.String())
require.Nil(t, err)

testTables = []libraryRuleFunctionTestTable{
{"Has broken symlink", testLibrary, ruleresult.Fail, ""},
}

checkLibraryRuleFunction(LibraryContainsSymlinks, testTables, t)

err = symlinkPath.RemoveAll()
require.Nil(t, err)

testTables = []libraryRuleFunctionTestTable{
{"No symlink", testLibrary, ruleresult.Pass, ""},
}
Expand Down
2 changes: 1 addition & 1 deletion ruledocsgen/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ replace github.com/jandelgado/gcov2lcov => github.com/jandelgado/gcov2lcov v1.0.
require (
github.com/JohannesKaufmann/html-to-markdown v1.4.0
github.com/arduino/arduino-lint v0.0.0
github.com/arduino/go-paths-helper v1.11.0
github.com/arduino/go-paths-helper v1.12.0
github.com/olekukonko/tablewriter v0.0.5
github.com/stretchr/testify v1.8.4
)
Expand Down
4 changes: 2 additions & 2 deletions ruledocsgen/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ github.com/arduino/board-discovery v0.0.0-20180823133458-1ba29327fb0c/go.mod h1:
github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
github.com/arduino/go-paths-helper v1.3.2/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
github.com/arduino/go-paths-helper v1.11.0 h1:hkpGb9AtCTByTj2FKutuHWb3klDf4kAKL10hW+fN+oE=
github.com/arduino/go-paths-helper v1.11.0/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM=
github.com/arduino/go-paths-helper v1.12.0 h1:xizOQtI9iHdl19qXd1EmWg5i9W//2bOCOYwlNv8F61E=
github.com/arduino/go-paths-helper v1.12.0/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM=
github.com/arduino/go-properties-orderedmap v1.3.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
github.com/arduino/go-properties-orderedmap v1.8.0 h1:wEfa6hHdpezrVOh787OmClsf/Kd8qB+zE3P2Xbrn0CQ=
github.com/arduino/go-properties-orderedmap v1.8.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
Expand Down