Add a Library Manager configuration for linting while indexing releases · arduino/arduino-lint@5acadea (original) (raw)

`@@ -34,6 +34,7 @@ const (

`

34

34

`Permissive // permissive

`

35

35

`LibraryManagerSubmission // submit

`

36

36

`LibraryManagerIndexed // update

`

``

37

`+

LibraryManagerIndexing // ARDUINO_LINT_LIBRARY_MANAGER_INDEXING

`

37

38

`Official // ARDUINO_LINT_OFFICIAL

`

38

39

`Default // default

`

39

40

`)

`

`@@ -47,6 +48,7 @@ var Types = map[Type]struct{}{

`

47

48

`Permissive: empty,

`

48

49

`LibraryManagerSubmission: empty,

`

49

50

`LibraryManagerIndexed: empty,

`

``

51

`+

LibraryManagerIndexing: empty,

`

50

52

`Official: empty,

`

51

53

`Default: empty,

`

52

54

`}

`

`@@ -66,16 +68,16 @@ func ComplianceModeFromString(complianceModeString string) (bool, bool, bool, er

`

66

68

`}

`

67

69

``

68

70

`// LibraryManagerModeFromString parses the --library-manager flag value and returns the corresponding rule mode settings.

`

69

``

`-

func LibraryManagerModeFromString(libraryManagerModeString string) (bool, bool, error) {

`

``

71

`+

func LibraryManagerModeFromString(libraryManagerModeString string) (bool, bool, bool, error) {

`

70

72

`switch strings.ToLower(libraryManagerModeString) {

`

71

73

`case LibraryManagerSubmission.String():

`

72

``

`-

return true, false, nil

`

``

74

`+

return true, false, false, nil

`

73

75

`case LibraryManagerIndexed.String():

`

74

``

`-

return false, true, nil

`

``

76

`+

return false, true, false, nil

`

75

77

`case "false":

`

76

``

`-

return false, false, nil

`

``

78

`+

return false, false, false, nil

`

77

79

`default:

`

78

``

`-

return false, false, fmt.Errorf("No matching Library Manager mode for string %s", libraryManagerModeString)

`

``

80

`+

return false, false, false, fmt.Errorf("No matching Library Manager mode for string %s", libraryManagerModeString)

`

79

81

` }

`

80

82

`}

`

81

83

``

`@@ -110,7 +112,7 @@ func Compliance(ruleModes map[Type]bool) string {

`

110

112

`// LibraryManager returns the string identifier for the Library Manager configuration mode.

`

111

113

`func LibraryManager(ruleModes map[Type]bool) string {

`

112

114

`for key, value := range ruleModes {

`

113

``

`-

if value && (key == LibraryManagerSubmission || key == LibraryManagerIndexed) {

`

``

115

`+

if value && (key == LibraryManagerSubmission || key == LibraryManagerIndexed || key == LibraryManagerIndexing) {

`

114

116

`return key.String()

`

115

117

` }

`

116

118

` }

`