Skip to content

Commit

Permalink
[skip-changelog] Removed useless file-readable check while enumeratin…
Browse files Browse the repository at this point in the history
…g source code files (#2418)

* Removed useless file filter

* Removed unused variable
  • Loading branch information
cmaglie authored Nov 14, 2023
1 parent 3d88eff commit 862a4cb
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions arduino/builder/internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"strings"
"unicode"

"github.com/arduino/arduino-cli/i18n"
f "github.com/arduino/arduino-cli/internal/algorithms"
"github.com/arduino/go-paths-helper"
"github.com/pkg/errors"
Expand All @@ -30,8 +29,6 @@ import (
"golang.org/x/text/unicode/norm"
)

var tr = i18n.Tr

// ObjFileIsUpToDate fixdoc
func ObjFileIsUpToDate(sourceFile, objectFile, dependencyFile *paths.Path) (bool, error) {
logrus.Debugf("Checking previous results for %v (result = %v, dep = %v)", sourceFile, objectFile, dependencyFile)
Expand Down Expand Up @@ -160,17 +157,6 @@ func filterOutSCCS(file *paths.Path) bool {
return !sourceControlFolders[file.Base()]
}

// filterReadableFiles is a ReadDirFilter that accepts only readable files
func filterReadableFiles(file *paths.Path) bool {
// See if the file is readable by opening it
f, err := file.Open()
if err != nil {
return false
}
f.Close()
return true
}

// filterOutHiddenFiles is a ReadDirFilter that exclude files with a "." prefix in their name
var filterOutHiddenFiles = paths.FilterOutPrefixes(".")

Expand All @@ -180,7 +166,6 @@ func FindFilesInFolder(dir *paths.Path, recurse bool, extensions ...string) (pat
filterOutHiddenFiles,
filterOutSCCS,
paths.FilterOutDirectories(),
filterReadableFiles,
)
if len(extensions) > 0 {
fileFilter = paths.AndFilter(
Expand Down

0 comments on commit 862a4cb

Please sign in to comment.