Skip to content

Commit 70add3b

Browse files
committed
Remove boards.txt debug.tool property rules
It turns out that the debug configuration system was completely reworked without updating the platform specification. This resulted in the specification-based rules that had been implemented being worthless.
1 parent 648291e commit 70add3b

File tree

6 files changed

+0
-151
lines changed

6 files changed

+0
-151
lines changed

etc/schemas/arduino-boards-txt-definitions-schema.json

-50
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@
134134
"build.core": {
135135
"$ref": "#/definitions/propertiesObjects/boardIDBuildCore/permissive/object"
136136
},
137-
"debug.tool": {
138-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/permissive/object"
139-
},
140137
"hide": {
141138
"$ref": "#/definitions/propertiesObjects/boardIDHide/permissive/object"
142139
},
@@ -202,9 +199,6 @@
202199
"build.core": {
203200
"$ref": "#/definitions/propertiesObjects/boardIDBuildCore/specification/object"
204201
},
205-
"debug.tool": {
206-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/specification/object"
207-
},
208202
"hide": {
209203
"$ref": "#/definitions/propertiesObjects/boardIDHide/specification/object"
210204
},
@@ -270,9 +264,6 @@
270264
"build.core": {
271265
"$ref": "#/definitions/propertiesObjects/boardIDBuildCore/strict/object"
272266
},
273-
"debug.tool": {
274-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/strict/object"
275-
},
276267
"hide": {
277268
"$ref": "#/definitions/propertiesObjects/boardIDHide/strict/object"
278269
},
@@ -445,47 +436,6 @@
445436
}
446437
}
447438
},
448-
"boardIDDebugTool": {
449-
"base": {
450-
"object": {
451-
"allOf": [
452-
{
453-
"type": "string"
454-
},
455-
{
456-
"minLength": 1
457-
}
458-
]
459-
}
460-
},
461-
"permissive": {
462-
"object": {
463-
"allOf": [
464-
{
465-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/base/object"
466-
}
467-
]
468-
}
469-
},
470-
"specification": {
471-
"object": {
472-
"allOf": [
473-
{
474-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/base/object"
475-
}
476-
]
477-
}
478-
},
479-
"strict": {
480-
"object": {
481-
"allOf": [
482-
{
483-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/base/object"
484-
}
485-
]
486-
}
487-
}
488-
},
489439
"boardIDHide": {
490440
"base": {
491441
"object": {

internal/project/platform/boardstxt/boardstxtschema_test.go

-4
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ func TestMinLength(t *testing.T) {
7575
{"foo.build.core", "foo/build\\.core", 1, compliancelevel.Specification},
7676
{"foo.build.core", "foo/build\\.core", 1, compliancelevel.Strict},
7777

78-
{"foo.debug.tool", "foo/debug\\.tool", 1, compliancelevel.Permissive},
79-
{"foo.debug.tool", "foo/debug\\.tool", 1, compliancelevel.Specification},
80-
{"foo.debug.tool", "foo/debug\\.tool", 1, compliancelevel.Strict},
81-
8278
{"foo.menu.bar.baz", "foo/menu\\.bar\\.baz", 1, compliancelevel.Permissive},
8379
{"foo.menu.bar.baz", "foo/menu\\.bar\\.baz", 1, compliancelevel.Specification},
8480
{"foo.menu.bar.baz", "foo/menu\\.bar\\.baz", 1, compliancelevel.Strict},

internal/rule/ruleconfiguration/ruleconfiguration.go

-16
Original file line numberDiff line numberDiff line change
@@ -1577,22 +1577,6 @@ var configurations = []Type{
15771577
ErrorModes: []rulemode.Type{rulemode.Strict},
15781578
RuleFunction: rulefunction.BoardsTxtUserExtraFlagsUsage,
15791579
},
1580-
{
1581-
ProjectType: projecttype.Platform,
1582-
SuperprojectType: projecttype.All,
1583-
Category: "configuration files",
1584-
Subcategory: "boards.txt",
1585-
ID: "PF010",
1586-
Brief: "debug.tool < min length",
1587-
Description: "",
1588-
MessageTemplate: "debug.tool value for board ID(s) {{.}} is less than the minimum length. See: https://arduino.github.io/arduino-cli/latest/platform-specification/#sketch-debugging-configuration",
1589-
DisableModes: nil,
1590-
EnableModes: []rulemode.Type{rulemode.Default},
1591-
InfoModes: nil,
1592-
WarningModes: nil,
1593-
ErrorModes: []rulemode.Type{rulemode.Default},
1594-
RuleFunction: rulefunction.BoardsTxtBoardIDDebugToolLTMinLength,
1595-
},
15961580
{
15971581
ProjectType: projecttype.Platform,
15981582
SuperprojectType: projecttype.All,

internal/rule/rulefunction/platform.go

-19
Original file line numberDiff line numberDiff line change
@@ -192,25 +192,6 @@ func BoardsTxtUserExtraFlagsUsage() (result ruleresult.Type, output string) {
192192
return ruleresult.Pass, ""
193193
}
194194

195-
// BoardsTxtBoardIDDebugToolLTMinLength checks if any of the board debug.tool values are less than the minimum length.
196-
func BoardsTxtBoardIDDebugToolLTMinLength() (result ruleresult.Type, output string) {
197-
if projectdata.BoardsTxtLoadError() != nil {
198-
return ruleresult.NotRun, "Couldn't load boards.txt"
199-
}
200-
201-
if len(projectdata.BoardsTxtBoardIds()) == 0 {
202-
return ruleresult.Skip, "boards.txt has no boards"
203-
}
204-
205-
nonCompliantBoardIDs := boardIDValueLTMinLength("debug\\.tool", compliancelevel.Specification)
206-
207-
if len(nonCompliantBoardIDs) > 0 {
208-
return ruleresult.Fail, strings.Join(nonCompliantBoardIDs, ", ")
209-
}
210-
211-
return ruleresult.Pass, ""
212-
}
213-
214195
// BoardsTxtBoardIDHideInvalid checks if any of the board hide values are less than the minimum length.
215196
func BoardsTxtBoardIDHideInvalid() (result ruleresult.Type, output string) {
216197
if projectdata.BoardsTxtLoadError() != nil {

internal/rule/rulefunction/platform_test.go

-12
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,6 @@ func TestBoardsTxtUserExtraFlagsUsage(t *testing.T) {
165165
checkPlatformRuleFunction(BoardsTxtUserExtraFlagsUsage, testTables, t)
166166
}
167167

168-
func TestBoardsTxtBoardIDDebugToolLTMinLength(t *testing.T) {
169-
testTables := []platformRuleFunctionTestTable{
170-
{"Missing", "missing-boards.txt", ruleresult.NotRun, ""},
171-
{"Invalid", "invalid-boards.txt", ruleresult.NotRun, ""},
172-
{"No boards", "no-boards-boards.txt", ruleresult.Skip, ""},
173-
{"Property LT min", "boardID-debug-tool-LT-boards.txt", ruleresult.Fail, "buno, funo"},
174-
{"Valid", "valid-boards.txt", ruleresult.Pass, ""},
175-
}
176-
177-
checkPlatformRuleFunction(BoardsTxtBoardIDDebugToolLTMinLength, testTables, t)
178-
}
179-
180168
func TestBoardsTxtBoardIDHideInvalid(t *testing.T) {
181169
testTables := []platformRuleFunctionTestTable{
182170
{"Missing", "missing-boards.txt", ruleresult.NotRun, ""},

internal/rule/schema/schemadata/bindata.go

-50
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,6 @@ var _arduinoBoardsTxtDefinitionsSchemaJson = []byte(`{
202202
"build.core": {
203203
"$ref": "#/definitions/propertiesObjects/boardIDBuildCore/permissive/object"
204204
},
205-
"debug.tool": {
206-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/permissive/object"
207-
},
208205
"hide": {
209206
"$ref": "#/definitions/propertiesObjects/boardIDHide/permissive/object"
210207
},
@@ -270,9 +267,6 @@ var _arduinoBoardsTxtDefinitionsSchemaJson = []byte(`{
270267
"build.core": {
271268
"$ref": "#/definitions/propertiesObjects/boardIDBuildCore/specification/object"
272269
},
273-
"debug.tool": {
274-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/specification/object"
275-
},
276270
"hide": {
277271
"$ref": "#/definitions/propertiesObjects/boardIDHide/specification/object"
278272
},
@@ -338,9 +332,6 @@ var _arduinoBoardsTxtDefinitionsSchemaJson = []byte(`{
338332
"build.core": {
339333
"$ref": "#/definitions/propertiesObjects/boardIDBuildCore/strict/object"
340334
},
341-
"debug.tool": {
342-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/strict/object"
343-
},
344335
"hide": {
345336
"$ref": "#/definitions/propertiesObjects/boardIDHide/strict/object"
346337
},
@@ -513,47 +504,6 @@ var _arduinoBoardsTxtDefinitionsSchemaJson = []byte(`{
513504
}
514505
}
515506
},
516-
"boardIDDebugTool": {
517-
"base": {
518-
"object": {
519-
"allOf": [
520-
{
521-
"type": "string"
522-
},
523-
{
524-
"minLength": 1
525-
}
526-
]
527-
}
528-
},
529-
"permissive": {
530-
"object": {
531-
"allOf": [
532-
{
533-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/base/object"
534-
}
535-
]
536-
}
537-
},
538-
"specification": {
539-
"object": {
540-
"allOf": [
541-
{
542-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/base/object"
543-
}
544-
]
545-
}
546-
},
547-
"strict": {
548-
"object": {
549-
"allOf": [
550-
{
551-
"$ref": "#/definitions/propertiesObjects/boardIDDebugTool/base/object"
552-
}
553-
]
554-
}
555-
}
556-
},
557507
"boardIDHide": {
558508
"base": {
559509
"object": {

0 commit comments

Comments
 (0)