Skip to content

Commit 646c0ee

Browse files
committed
Fixed FIELD_LOWER_SNAKE_CASE lint warning
1 parent 7ef527a commit 646c0ee

34 files changed

+1324
-1332
lines changed

cli/board/details.go

Lines changed: 3 additions & 3 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 6 additions & 6 deletions
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

Lines changed: 3 additions & 3 deletions
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")

0 commit comments

Comments
 (0)