Skip to content

Commit 05c4f69

Browse files
committed
Fixed FIELD_LOWER_SNAKE_CASE lint warning
1 parent 93000e0 commit 05c4f69

34 files changed

+1324
-1332
lines changed

cli/board/details.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,17 @@ func (dr detailsResult) String() string {
137137
for i, idp := range details.IdentificationPref {
138138
if i == 0 {
139139
t.AddRow() // get some space from above
140-
t.AddRow(tr("Identification properties:"), "VID:"+idp.UsbID.VID+" PID:"+idp.UsbID.PID)
140+
t.AddRow(tr("Identification properties:"), "VID:"+idp.UsbId.Vid+" PID:"+idp.UsbId.Pid)
141141
continue
142142
}
143-
t.AddRow("", "VID:"+idp.UsbID.VID+" PID:"+idp.UsbID.PID)
143+
t.AddRow("", "VID:"+idp.UsbId.Vid+" PID:"+idp.UsbId.Pid)
144144
}
145145

146146
t.AddRow() // get some space from above
147147
addIfNotEmpty(tr("Package name:"), details.Package.Name)
148148
addIfNotEmpty(tr("Package maintainer:"), details.Package.Maintainer)
149149
addIfNotEmpty(tr("Package URL:"), details.Package.Url)
150-
addIfNotEmpty(tr("Package website:"), details.Package.WebsiteURL)
150+
addIfNotEmpty(tr("Package website:"), details.Package.WebsiteUrl)
151151
addIfNotEmpty(tr("Package online help:"), details.Package.Help.Online)
152152

153153
t.AddRow() // get some space from above

cli/board/list.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ func (dr result) String() string {
147147
if boards := port.GetBoards(); len(boards) > 0 {
148148
sort.Slice(boards, func(i, j int) bool {
149149
x, y := boards[i], boards[j]
150-
return x.GetName() < y.GetName() || (x.GetName() == y.GetName() && x.GetFQBN() < y.GetFQBN())
150+
return x.GetName() < y.GetName() || (x.GetName() == y.GetName() && x.GetFqbn() < y.GetFqbn())
151151
})
152152
for _, b := range boards {
153153
board := b.GetName()
154154

155155
// to improve the user experience, show on a dedicated column
156156
// the name of the core supporting the board detected
157157
var coreName = ""
158-
fqbn, err := cores.ParseFQBN(b.GetFQBN())
158+
fqbn, err := cores.ParseFQBN(b.GetFqbn())
159159
if err == nil {
160160
coreName = fmt.Sprintf("%s:%s", fqbn.Package, fqbn.PlatformArch)
161161
}
@@ -206,15 +206,15 @@ func (dr watchEvent) String() string {
206206
if boards := dr.Boards; len(boards) > 0 {
207207
sort.Slice(boards, func(i, j int) bool {
208208
x, y := boards[i], boards[j]
209-
return x.GetName() < y.GetName() || (x.GetName() == y.GetName() && x.GetFQBN() < y.GetFQBN())
209+
return x.GetName() < y.GetName() || (x.GetName() == y.GetName() && x.GetFqbn() < y.GetFqbn())
210210
})
211211
for _, b := range boards {
212212
board := b.GetName()
213213

214214
// to improve the user experience, show on a dedicated column
215215
// the name of the core supporting the board detected
216216
var coreName = ""
217-
fqbn, err := cores.ParseFQBN(b.GetFQBN())
217+
fqbn, err := cores.ParseFQBN(b.GetFqbn())
218218
if err == nil {
219219
coreName = fmt.Sprintf("%s:%s", fqbn.Package, fqbn.PlatformArch)
220220
}

cli/board/listall.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (dr resultAll) String() string {
9191
if item.IsHidden {
9292
hidden = "(hidden)"
9393
}
94-
t.AddRow(item.GetName(), item.GetFQBN(), hidden)
94+
t.AddRow(item.GetName(), item.GetFqbn(), hidden)
9595
}
9696
return t.Render()
9797
}

cli/board/search.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (r searchResults) String() string {
9393
if item.IsHidden {
9494
hidden = "(hidden)"
9595
}
96-
t.AddRow(item.GetName(), item.GetFQBN(), item.Platform.ID, hidden)
96+
t.AddRow(item.GetName(), item.GetFqbn(), item.Platform.Id, hidden)
9797
}
9898
return t.Render()
9999
}

cli/core/list.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ func (ir installedResult) String() string {
8888
t := table.New()
8989
t.SetHeader("ID", "Installed", "Latest", "Name")
9090
sort.Slice(ir.platforms, func(i, j int) bool {
91-
return ir.platforms[i].ID < ir.platforms[j].ID
91+
return ir.platforms[i].Id < ir.platforms[j].Id
9292
})
9393
for _, p := range ir.platforms {
94-
t.AddRow(p.ID, p.Installed, p.Latest, p.Name)
94+
t.AddRow(p.Id, p.Installed, p.Latest, p.Name)
9595
}
9696

9797
return t.Render()

cli/core/search.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ func (sr searchResults) String() string {
9898
t := table.New()
9999
t.SetHeader("ID", "Version", "Name")
100100
sort.Slice(sr.platforms, func(i, j int) bool {
101-
return sr.platforms[i].ID < sr.platforms[j].ID
101+
return sr.platforms[i].Id < sr.platforms[j].Id
102102
})
103103
for _, item := range sr.platforms {
104-
t.AddRow(item.GetID(), item.GetLatest(), item.GetName())
104+
t.AddRow(item.GetId(), item.GetLatest(), item.GetName())
105105
}
106106
return t.Render()
107107
}

cli/core/upgrade.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) {
7272
}
7373

7474
for _, t := range targets {
75-
args = append(args, t.ID)
75+
args = append(args, t.Id)
7676
}
7777
}
7878

commands/board/details.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai
6161
details.Package = &rpc.Package{
6262
Name: boardPackage.Name,
6363
Maintainer: boardPackage.Maintainer,
64-
WebsiteURL: boardPackage.WebsiteURL,
64+
WebsiteUrl: boardPackage.WebsiteURL,
6565
Email: boardPackage.Email,
6666
Help: &rpc.Help{Online: boardPackage.Help.Online},
6767
Url: boardPackage.URL,
@@ -85,7 +85,7 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai
8585
pids := board.Properties.SubTree("pid")
8686
for id, vid := range vids.AsMap() {
8787
if pid, ok := pids.GetOk(id); ok {
88-
idPref := rpc.IdentificationPref{UsbID: &rpc.USBID{VID: vid, PID: pid}}
88+
idPref := rpc.IdentificationPref{UsbId: &rpc.USBID{Vid: vid, Pid: pid}}
8989
details.IdentificationPref = append(details.IdentificationPref, &idPref)
9090
}
9191
}

commands/board/list.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ func apiByVidPid(vid, pid string) ([]*rpc.BoardListItem, error) {
8888

8989
retVal = append(retVal, &rpc.BoardListItem{
9090
Name: name,
91-
FQBN: fqbn,
92-
VID: vid,
93-
PID: pid,
91+
Fqbn: fqbn,
92+
Vid: vid,
93+
Pid: pid,
9494
})
9595
} else {
9696
return nil, errors.Wrap(err, "error querying Arduino Cloud Api")
@@ -119,9 +119,9 @@ func identify(pm *packagemanager.PackageManager, port *commands.BoardPort) ([]*r
119119
for _, board := range pm.IdentifyBoard(port.IdentificationPrefs) {
120120
boards = append(boards, &rpc.BoardListItem{
121121
Name: board.Name(),
122-
FQBN: board.FQBN(),
123-
VID: port.IdentificationPrefs.Get("vid"),
124-
PID: port.IdentificationPrefs.Get("pid"),
122+
Fqbn: board.FQBN(),
123+
Vid: port.IdentificationPrefs.Get("vid"),
124+
Pid: port.IdentificationPrefs.Get("pid"),
125125
})
126126
}
127127

commands/board/list_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ func TestGetByVidPid(t *testing.T) {
5252
require.Nil(t, err)
5353
require.Len(t, res, 1)
5454
require.Equal(t, "Arduino/Genuino MKR1000", res[0].Name)
55-
require.Equal(t, "arduino:samd:mkr1000", res[0].FQBN)
56-
require.Equal(t, "0xf420", res[0].VID)
57-
require.Equal(t, "0XF069", res[0].PID)
55+
require.Equal(t, "arduino:samd:mkr1000", res[0].Fqbn)
56+
require.Equal(t, "0xf420", res[0].Vid)
57+
require.Equal(t, "0XF069", res[0].Pid)
5858

5959
// wrong vid (too long), wrong pid (not an hex value)
6060
res, err = apiByVidPid("0xfffff", "0xDEFG")

commands/board/listall.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func ListAll(ctx context.Context, req *rpc.BoardListAllRequest) (*rpc.BoardListA
6767
}
6868

6969
rpcPlatform := &rpc.Platform{
70-
ID: platform.String(),
70+
Id: platform.String(),
7171
Installed: installedVersion,
7272
Latest: latestVersion,
7373
Name: platform.Name,
@@ -99,7 +99,7 @@ func ListAll(ctx context.Context, req *rpc.BoardListAllRequest) (*rpc.BoardListA
9999

100100
list.Boards = append(list.Boards, &rpc.BoardListItem{
101101
Name: board.Name(),
102-
FQBN: board.FQBN(),
102+
Fqbn: board.FQBN(),
103103
IsHidden: board.IsHidden(),
104104
Platform: rpcPlatform,
105105
})

commands/board/search.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR
6868
}
6969

7070
rpcPlatform := &rpc.Platform{
71-
ID: platform.String(),
71+
Id: platform.String(),
7272
Installed: installedVersion,
7373
Latest: latestPlatformRelease.Version.String(),
7474
Name: platform.Name,
@@ -98,7 +98,7 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR
9898

9999
res.Boards = append(res.Boards, &rpc.BoardListItem{
100100
Name: board.Name(),
101-
FQBN: board.FQBN(),
101+
Fqbn: board.FQBN(),
102102
IsHidden: board.IsHidden(),
103103
Platform: rpcPlatform,
104104
})

commands/core.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform
5151
}
5252

5353
result := &rpc.Platform{
54-
ID: platformRelease.Platform.String(),
54+
Id: platformRelease.Platform.String(),
5555
Name: platformRelease.Platform.Name,
5656
Maintainer: platformRelease.Platform.Package.Maintainer,
5757
Website: platformRelease.Platform.Package.WebsiteURL,

commands/core/search_test.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestPlatformSearch(t *testing.T) {
5555

5656
require.Len(t, res.SearchOutput, 2)
5757
require.Contains(t, res.SearchOutput, &commands.Platform{
58-
ID: "Retrokits-RK002:arm",
58+
Id: "Retrokits-RK002:arm",
5959
Installed: "",
6060
Latest: "1.0.5",
6161
Name: "RK002",
@@ -65,7 +65,7 @@ func TestPlatformSearch(t *testing.T) {
6565
Boards: []*commands.Board{{Name: "RK002"}},
6666
})
6767
require.Contains(t, res.SearchOutput, &commands.Platform{
68-
ID: "Retrokits-RK002:arm",
68+
Id: "Retrokits-RK002:arm",
6969
Installed: "",
7070
Latest: "1.0.6",
7171
Name: "RK002",
@@ -84,7 +84,7 @@ func TestPlatformSearch(t *testing.T) {
8484
require.NotNil(t, res)
8585
require.Len(t, res.SearchOutput, 1)
8686
require.Contains(t, res.SearchOutput, &commands.Platform{
87-
ID: "Retrokits-RK002:arm",
87+
Id: "Retrokits-RK002:arm",
8888
Installed: "",
8989
Latest: "1.0.6",
9090
Name: "RK002",
@@ -104,7 +104,7 @@ func TestPlatformSearch(t *testing.T) {
104104
require.NotNil(t, res)
105105
require.Len(t, res.SearchOutput, 2)
106106
require.Contains(t, res.SearchOutput, &commands.Platform{
107-
ID: "Retrokits-RK002:arm",
107+
Id: "Retrokits-RK002:arm",
108108
Installed: "",
109109
Latest: "1.0.5",
110110
Name: "RK002",
@@ -114,7 +114,7 @@ func TestPlatformSearch(t *testing.T) {
114114
Boards: []*commands.Board{{Name: "RK002"}},
115115
})
116116
require.Contains(t, res.SearchOutput, &commands.Platform{
117-
ID: "Retrokits-RK002:arm",
117+
Id: "Retrokits-RK002:arm",
118118
Installed: "",
119119
Latest: "1.0.6",
120120
Name: "RK002",
@@ -134,7 +134,7 @@ func TestPlatformSearch(t *testing.T) {
134134
require.NotNil(t, res)
135135
require.Len(t, res.SearchOutput, 2)
136136
require.Contains(t, res.SearchOutput, &commands.Platform{
137-
ID: "Retrokits-RK002:arm",
137+
Id: "Retrokits-RK002:arm",
138138
Installed: "",
139139
Latest: "1.0.5",
140140
Name: "RK002",
@@ -144,7 +144,7 @@ func TestPlatformSearch(t *testing.T) {
144144
Boards: []*commands.Board{{Name: "RK002"}},
145145
})
146146
require.Contains(t, res.SearchOutput, &commands.Platform{
147-
ID: "Retrokits-RK002:arm",
147+
Id: "Retrokits-RK002:arm",
148148
Installed: "",
149149
Latest: "1.0.6",
150150
Name: "RK002",
@@ -164,7 +164,7 @@ func TestPlatformSearch(t *testing.T) {
164164
require.NotNil(t, res)
165165
require.Len(t, res.SearchOutput, 2)
166166
require.Contains(t, res.SearchOutput, &commands.Platform{
167-
ID: "Retrokits-RK002:arm",
167+
Id: "Retrokits-RK002:arm",
168168
Installed: "",
169169
Latest: "1.0.5",
170170
Name: "RK002",
@@ -174,7 +174,7 @@ func TestPlatformSearch(t *testing.T) {
174174
Boards: []*commands.Board{{Name: "RK002"}},
175175
})
176176
require.Contains(t, res.SearchOutput, &commands.Platform{
177-
ID: "Retrokits-RK002:arm",
177+
Id: "Retrokits-RK002:arm",
178178
Installed: "",
179179
Latest: "1.0.6",
180180
Name: "RK002",
@@ -194,7 +194,7 @@ func TestPlatformSearch(t *testing.T) {
194194
require.NotNil(t, res)
195195
require.Len(t, res.SearchOutput, 1)
196196
require.Contains(t, res.SearchOutput, &commands.Platform{
197-
ID: "arduino:avr",
197+
Id: "arduino:avr",
198198
Installed: "",
199199
Latest: "1.8.3",
200200
Name: "Arduino AVR Boards",
@@ -240,7 +240,7 @@ func TestPlatformSearch(t *testing.T) {
240240
require.NotNil(t, res)
241241
require.Len(t, res.SearchOutput, 1)
242242
require.Contains(t, res.SearchOutput, &commands.Platform{
243-
ID: "arduino:avr",
243+
Id: "arduino:avr",
244244
Installed: "",
245245
Latest: "1.8.3",
246246
Name: "Arduino AVR Boards",

commands/daemon/monitor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (s *MonitorService) StreamingOpen(stream rpc.MonitorService_StreamingOpenSe
3737
}
3838

3939
// ensure it's a config message and not data
40-
config := msg.GetMonitorConfig()
40+
config := msg.GetConfig()
4141
if config == nil {
4242
return fmt.Errorf("first message must contain monitor configuration, not data")
4343
}

rpc/buf.yaml

-10
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ lint:
44
ENUM_ZERO_VALUE_SUFFIX:
55
- commands/lib.proto
66
- monitor/monitor.proto
7-
FIELD_LOWER_SNAKE_CASE:
8-
- commands/board.proto
9-
- commands/commands.proto
10-
- commands/common.proto
11-
- commands/compile.proto
12-
- commands/core.proto
13-
- commands/lib.proto
14-
- debug/debug.proto
15-
- monitor/monitor.proto
16-
- settings/settings.proto
177
PACKAGE_DIRECTORY_MATCH:
188
- commands/board.proto
199
- commands/commands.proto

0 commit comments

Comments
 (0)