Skip to content

Commit 30018d6

Browse files
committed
Rename configuration.SuperprojectType() to configuration.SuperprojectTypeFilter()
The name "SuperprojectType" is too vague and used as a project.Type field name to mean a completely different thing.
1 parent d4b2e56 commit 30018d6

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

configuration/configuration.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ func Initialize() {
2828
logrus.SetLevel(logrus.PanicLevel)
2929

3030
logrus.WithFields(logrus.Fields{
31-
"superproject type": SuperprojectType().String(),
32-
"recursive": Recursive(),
33-
"projects path": TargetPath().String(),
31+
"superproject type filter": SuperprojectTypeFilter().String(),
32+
"recursive": Recursive(),
33+
"projects path": TargetPath().String(),
3434
}).Debug("Configuration initialized")
3535
}
3636

@@ -41,11 +41,11 @@ func CheckModes(superprojectType projecttype.Type) map[checkmode.Type]bool {
4141
return checkmode.Modes(defaultCheckModes, customCheckModes, superprojectType)
4242
}
4343

44-
var superprojectType projecttype.Type
44+
var superprojectTypeFilter projecttype.Type
4545

4646
// SuperprojectType returns the superproject type filter configuration.
47-
func SuperprojectType() projecttype.Type {
48-
return superprojectType
47+
func SuperprojectTypeFilter() projecttype.Type {
48+
return superprojectTypeFilter
4949
}
5050

5151
var recursive bool

configuration/defaults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func setDefaults() {
11-
superprojectType = projecttype.All
11+
superprojectTypeFilter = projecttype.All
1212
recursive = true
1313
// TODO: targetPath defaults to current path
1414
}

project/project.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type Type struct {
2525
// It returns a slice containing the definitions of each found project.
2626
func FindProjects() ([]Type, error) {
2727
targetPath := configuration.TargetPath()
28-
superprojectTypeConfiguration := configuration.SuperprojectType()
28+
superprojectTypeFilter := configuration.SuperprojectTypeFilter()
2929
recursive := configuration.Recursive()
3030

3131
var foundProjects []Type
@@ -34,7 +34,7 @@ func FindProjects() ([]Type, error) {
3434
if targetPath.IsNotDir() {
3535
logrus.Debug("Projects path is file")
3636
// The filename provides additional information about the project type. So rather than using isProject(), which doesn't make use this information, use a specialized function that does.
37-
isProject, projectType := isProjectIndicatorFile(targetPath, superprojectTypeConfiguration)
37+
isProject, projectType := isProjectIndicatorFile(targetPath, superprojectTypeFilter)
3838
if isProject {
3939
foundProject := Type{
4040
Path: targetPath.Parent(),
@@ -51,7 +51,7 @@ func FindProjects() ([]Type, error) {
5151
return nil, fmt.Errorf("specified path %s is not an Arduino project", targetPath.String())
5252
}
5353

54-
foundProjects = append(foundProjects, findProjects(targetPath, superprojectTypeConfiguration, recursive)...)
54+
foundProjects = append(foundProjects, findProjects(targetPath, superprojectTypeFilter, recursive)...)
5555

5656
if foundProjects == nil {
5757
return nil, fmt.Errorf("no projects found under %s", targetPath.String())

0 commit comments

Comments
 (0)