|
1 | 1 | package checkfunctions
|
2 | 2 |
|
3 | 3 | import (
|
4 |
| - "github.com/arduino/arduino-check/check/checkdata" |
5 | 4 | "github.com/arduino/arduino-check/check/checkresult"
|
6 |
| - "github.com/arduino/arduino-check/project/library/libraryproperties" |
7 | 5 | )
|
8 | 6 |
|
9 | 7 | // output is the contextual information that will be added to the stock message
|
10 | 8 | type Type func() (result checkresult.Type, output string)
|
11 |
| - |
12 |
| -func LibraryPropertiesFormat() (result checkresult.Type, output string) { |
13 |
| - if checkdata.LibraryPropertiesLoadError() != nil { |
14 |
| - return checkresult.Fail, checkdata.LibraryPropertiesLoadError().Error() |
15 |
| - } |
16 |
| - return checkresult.Pass, "" |
17 |
| -} |
18 |
| - |
19 |
| -func LibraryPropertiesNameFieldMissing() (result checkresult.Type, output string) { |
20 |
| - if checkdata.LibraryPropertiesLoadError() != nil { |
21 |
| - return checkresult.NotRun, "" |
22 |
| - } |
23 |
| - |
24 |
| - if libraryproperties.FieldMissing("name", checkdata.LibraryPropertiesSchemaValidationResult()) { |
25 |
| - return checkresult.Fail, "" |
26 |
| - } |
27 |
| - return checkresult.Pass, "" |
28 |
| -} |
29 |
| - |
30 |
| -func LibraryPropertiesNameFieldDisallowedCharacters() (result checkresult.Type, output string) { |
31 |
| - if checkdata.LibraryPropertiesLoadError() != nil { |
32 |
| - return checkresult.NotRun, "" |
33 |
| - } |
34 |
| - |
35 |
| - if libraryproperties.FieldPatternMismatch("name", checkdata.LibraryPropertiesSchemaValidationResult()) { |
36 |
| - return checkresult.Fail, "" |
37 |
| - } |
38 |
| - |
39 |
| - return checkresult.Pass, "" |
40 |
| -} |
41 |
| - |
42 |
| -func LibraryPropertiesVersionFieldMissing() (result checkresult.Type, output string) { |
43 |
| - if checkdata.LibraryPropertiesLoadError() != nil { |
44 |
| - return checkresult.NotRun, "" |
45 |
| - } |
46 |
| - |
47 |
| - if libraryproperties.FieldMissing("version", checkdata.LibraryPropertiesSchemaValidationResult()) { |
48 |
| - return checkresult.Fail, "" |
49 |
| - } |
50 |
| - return checkresult.Pass, "" |
51 |
| -} |
0 commit comments