Skip to content

Commit 1b4c1cb

Browse files
author
Mattia Bertorello
committed
Fixed all the problem reported by lll (max line length set to 160)
1 parent 4cdf899 commit 1b4c1cb

File tree

14 files changed

+123
-46
lines changed

14 files changed

+123
-46
lines changed

Diff for: .golangci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ linters-settings:
1212
goconst:
1313
min-len: 2
1414
min-occurrences: 2
15+
lll:
16+
line-length: 160
1517

1618
misspell:
1719
locale: US
@@ -25,7 +27,6 @@ linters:
2527
- goconst
2628
- gocyclo
2729
- govet
28-
- lll
2930
- maligned
3031
- megacheck
3132
- unparam

Diff for: arduino/cores/fqbn_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,7 @@ func TestFQBN(t *testing.T) {
119119
require.Equal(t, f.Package, "arduino")
120120
require.Equal(t, f.PlatformArch, "avr")
121121
require.Equal(t, f.BoardID, "uno")
122-
require.Equal(t, "properties.Map{\n \"cpu\": \"atmega\",\n \"extra\": \"core=arduino\",\n \"speed\": \"1000\",\n}", f.Configs.Dump())
122+
require.Equal(t,
123+
"properties.Map{\n \"cpu\": \"atmega\",\n \"extra\": \"core=arduino\",\n \"speed\": \"1000\",\n}",
124+
f.Configs.Dump())
123125
}

Diff for: auth/auth.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ type Config struct {
5454
// ClientID is the client id you are using
5555
ClientID string
5656

57-
// RedirectURI is the redirectURI where the oauth process will redirect. It's only required since the oauth system checks for it, but we intercept the redirect before hitting it
57+
// RedirectURI is the redirectURI where the oauth process will redirect.
58+
// It's only required since the oauth system checks for it, but we intercept the redirect before hitting it
5859
RedirectURI string
5960

6061
// Scopes is a space-separated list of scopes to require
@@ -157,7 +158,8 @@ func (c *Config) Refresh(token string) (*Token, error) {
157158
// cookies keeps track of the cookies for each request
158159
type cookies map[string][]*http.Cookie
159160

160-
// requestAuth calls hydra and follows the redirects until it reaches the authentication page. It saves the cookie it finds so it can apply them to subsequent requests
161+
// requestAuth calls hydra and follows the redirects until it reaches the authentication page.
162+
// It saves the cookie it finds so it can apply them to subsequent requests
161163
func (c *Config) requestAuth(client *http.Client) (string, cookies, error) {
162164
uri, err := url.Parse(c.CodeURL)
163165
if err != nil {

Diff for: builder_client_helpers/compilations.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ func StartCompilationsPath() string {
3030
return fmt.Sprintf("/builder/v1/compile")
3131
}
3232

33-
// Start a compilation for the given user and saves the request (but not the generated files) on the database. requires authentication. Can return PreconditionFailed if the user has reached their maximum number of compilations per day. If the compilation failed it returns UnprocessableEntity
33+
// Start a compilation for the given user and saves the request (but not the generated files) on the database.
34+
// requires authentication.
35+
// Can return PreconditionFailed if the user has reached their maximum number of compilations per day.
36+
// If the compilation failed it returns UnprocessableEntity
3437
func (c *Client) StartCompilations(ctx context.Context, path string, payload *Compilation) (*http.Response, error) {
3538
req, err := c.NewStartCompilationsRequest(ctx, path, payload)
3639
if err != nil {

Diff for: builder_client_helpers/libraries.go

+8-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ func ListLibrariesPath() string {
2929
return fmt.Sprintf("/builder/v1/libraries")
3030
}
3131

32-
// ListLibraries provides a list of all the latest versions of the libraries supported by Arduino Create. Doesn't require any authentication.
33-
func (c *Client) ListLibraries(ctx context.Context, path string, maintainer *string, type1 *string, withoutType *string) (*http.Response, error) {
32+
// ListLibraries provides a list of all the latest versions of the libraries supported by Arduino Create.
33+
// Doesn't require any authentication.
34+
func (c *Client) ListLibraries(
35+
ctx context.Context,
36+
path string, maintainer *string, type1 *string, withoutType *string) (*http.Response, error) {
37+
3438
req, err := c.NewListLibrariesRequest(ctx, path, maintainer, type1, withoutType)
3539
if err != nil {
3640
return nil, err
@@ -68,7 +72,8 @@ func ShowLibrariesPath(id string) string {
6872
return fmt.Sprintf("/builder/v1/libraries/%s", id)
6973
}
7074

71-
// ShowLibraries provides the library identified by the :id and :pid param. Doesn't require authentication. Also contains a list of other versions of the library
75+
// ShowLibraries provides the library identified by the :id and :pid param. Doesn't require authentication.
76+
// Also contains a list of other versions of the library
7277
func (c *Client) ShowLibraries(ctx context.Context, path string) (*http.Response, error) {
7378
req, err := c.NewShowLibrariesRequest(ctx, path)
7479
if err != nil {

Diff for: builder_client_helpers/media_types.go

+30-10
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ import (
2424
"github.com/goadesign/goa"
2525
)
2626

27-
// ArduinoBuilderBoard is a physical board belonging to a certain architecture in a package. The most obvious package is arduino, which contains architectures avr, sam and samd. It can contain multiple versions of the upload commands and options. If there is a default version it means that it's the only version officially supported. Of course if there is only one version it will be called default (default view)
27+
// ArduinoBuilderBoard is a physical board belonging to a certain architecture in a package.
28+
// The most obvious package is arduino, which contains architectures avr, sam and samd.
29+
// It can contain multiple versions of the upload commands and options.
30+
// If there is a default version it means that it's the only version officially supported.
31+
// Of course if there is only one version it will be called default (default view)
2832
//
2933
// Identifier: application/vnd.arduino.builder.board+json; view=default
3034
type ArduinoBuilderBoard struct {
@@ -160,7 +164,11 @@ func (c *Client) DecodeArduinoBuilderBoardsv2(resp *http.Response) (*ArduinoBuil
160164
return &decoded, err
161165
}
162166

163-
// ArduinoBuilderBoardv2 is a physical board belonging to a certain architecture in a package. The most obvious package is arduino, which contains architectures avr, sam and samd. It can contain multiple versions of the upload commands and options. If there is a default version it means that it's the only version officially supported. Of course if there is only one version it will be called default (default view)
167+
// ArduinoBuilderBoardv2 is a physical board belonging to a certain architecture in a package.
168+
// The most obvious package is arduino, which contains architectures avr, sam and samd.
169+
// It can contain multiple versions of the upload commands and options.
170+
// If there is a default version it means that it's the only version officially supported.
171+
// Of course if there is only one version it will be called default (default view)
164172
//
165173
// Identifier: application/vnd.arduino.builder.boardv2+json; view=default
166174
type ArduinoBuilderBoardv2 struct {
@@ -177,7 +185,11 @@ type ArduinoBuilderBoardv2 struct {
177185
Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
178186
}
179187

180-
// ArduinoBuilderBoardv2Full is a physical board belonging to a certain architecture in a package. The most obvious package is arduino, which contains architectures avr, sam and samd. It can contain multiple versions of the upload commands and options. If there is a default version it means that it's the only version officially supported. Of course if there is only one version it will be called default (full view)
188+
// ArduinoBuilderBoardv2Full is a physical board belonging to a certain architecture in a package.
189+
// The most obvious package is arduino, which contains architectures avr, sam and samd.
190+
// It can contain multiple versions of the upload commands and options.
191+
// If there is a default version it means that it's the only version officially supported.
192+
// Of course if there is only one version it will be called default (full view)
181193
//
182194
// Identifier: application/vnd.arduino.builder.boardv2+json; view=full
183195
type ArduinoBuilderBoardv2Full struct {
@@ -343,7 +355,9 @@ func (c *Client) DecodeArduinoBuilderBoardv2FullCollection(resp *http.Response)
343355
return decoded, err
344356
}
345357

346-
// ArduinoBuilderCompilationResult is the result of a compilation. It contains the output and the eventual errors. If successful it contains the generated files. (default view)
358+
// ArduinoBuilderCompilationResult is the result of a compilation.
359+
// It contains the output and the eventual errors.
360+
// If successful it contains the generated files. (default view)
347361
//
348362
// Identifier: application/vnd.arduino.builder.compilation.result; view=default
349363
type ArduinoBuilderCompilationResult struct {
@@ -388,8 +402,8 @@ type ArduinoBuilderExample struct {
388402
Types []string `form:"types,omitempty" json:"types,omitempty" xml:"types,omitempty"`
389403
}
390404

391-
// An ArduinoBuilderExampleLink is a simple sketch with the purpose of demonstrating the capabilities of the language. (link view)
392-
//
405+
// An ArduinoBuilderExampleLink is a simple sketch with the purpose of demonstrating the capabilities of the language.
406+
// (link view)
393407
// Identifier: application/vnd.arduino.builder.example+json; view=link
394408
type ArduinoBuilderExampleLink struct {
395409
// The url where to find the details
@@ -471,7 +485,9 @@ func (c *Client) DecodeArduinoBuilderFileCollection(resp *http.Response) (Arduin
471485
return decoded, err
472486
}
473487

474-
// ArduinoBuilderLibrary is a collection of header files containing arduino reusable code and functions. It typically contains its info in a library.properties files. The examples property contains a list of examples that use that library. (default view)
488+
// ArduinoBuilderLibrary is a collection of header files containing arduino reusable code and functions.
489+
// It typically contains its info in a library.properties files.
490+
// The examples property contains a list of examples that use that library. (default view)
475491
//
476492
// Identifier: application/vnd.arduino.builder.library+json; view=default
477493
type ArduinoBuilderLibrary struct {
@@ -489,7 +505,8 @@ type ArduinoBuilderLibrary struct {
489505
Files []*ArduinoBuilderFile `form:"files,omitempty" json:"files,omitempty" xml:"files,omitempty"`
490506
// The url where to find the details
491507
Href *string `form:"href,omitempty" json:"href,omitempty" xml:"href,omitempty"`
492-
// The id of the library. It could be a combination of name and version, a combination of the package and architecture, or an uuid id
508+
// The id of the library.
509+
// It could be a combination of name and version, a combination of the package and architecture, or an uuid id
493510
ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
494511
// The maintainer of the library
495512
Maintainer *string `form:"maintainer,omitempty" json:"maintainer,omitempty" xml:"maintainer,omitempty"`
@@ -507,7 +524,9 @@ type ArduinoBuilderLibrary struct {
507524
Version *string `form:"version,omitempty" json:"version,omitempty" xml:"version,omitempty"`
508525
}
509526

510-
// ArduinoBuilderLibraryLink is a collection of header files containing arduino reusable code and functions. It typically contains its info in a library.properties files. The examples property contains a list of examples that use that library. (link view)
527+
// ArduinoBuilderLibraryLink is a collection of header files containing arduino reusable code and functions.
528+
// It typically contains its info in a library.properties files.
529+
// The examples property contains a list of examples that use that library. (link view)
511530
//
512531
// Identifier: application/vnd.arduino.builder.library+json; view=link
513532
type ArduinoBuilderLibraryLink struct {
@@ -542,7 +561,8 @@ type ArduinoBuilderSlimlibrary struct {
542561
// The number of examples that it contains
543562
ExamplesNumber *int `form:"examples_number,omitempty" json:"examples_number,omitempty" xml:"examples_number,omitempty"`
544563
Href *string `form:"href,omitempty" json:"href,omitempty" xml:"href,omitempty"`
545-
// The id of the library. It could be a combination of name and version, a combination of the package and architecture, or an uuid id
564+
// The id of the library.
565+
// It could be a combination of name and version, a combination of the package and architecture, or an uuid id
546566
ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
547567
// The maintainer of the library
548568
Maintainer *string `form:"maintainer,omitempty" json:"maintainer,omitempty" xml:"maintainer,omitempty"`

Diff for: builder_client_helpers/pinned_libraries.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ func (c *Client) AddPinnedLibraries(ctx context.Context, path string) (*http.Res
4040
return c.Client.Do(ctx, req)
4141
}
4242

43-
// NewAddPinnedLibrariesRequest create the request corresponding to the add action endpoint of the pinnedLibraries resource.
43+
// NewAddPinnedLibrariesRequest create the request
44+
// corresponding to the add action endpoint of the pinnedLibraries resource.
4445
func (c *Client) NewAddPinnedLibrariesRequest(ctx context.Context, path string) (*http.Request, error) {
4546
scheme := c.Scheme
4647
if scheme == "" {

Diff for: builder_client_helpers/user_types.go

+19-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import (
2121
"github.com/goadesign/goa"
2222
)
2323

24-
// A compilation is made up of a sketch (or a path to a sketch) and an fqbn. Eventual libraries are automatically determined and linked. NOTE: swagger will force you to define the files inside the sketch because of a bug. But they are not mandatory.
24+
// A compilation is made up of a sketch (or a path to a sketch) and an fqbn.
25+
// Eventual libraries are automatically determined and linked.
26+
// NOTE: swagger will force you to define the files inside the sketch because of a bug. But they are not mandatory.
2527
type compilation struct {
2628
// The fully qualified board name
2729
Fqbn *string `form:"fqbn,omitempty" json:"fqbn,omitempty" xml:"fqbn,omitempty"`
@@ -72,7 +74,9 @@ func (ut *compilation) Publicize() *Compilation {
7274
return &pub
7375
}
7476

75-
// A Compilation is made up of a sketch (or a path to a sketch) and an fqbn. Eventual libraries are automatically determined and linked. NOTE: swagger will force you to define the files inside the sketch because of a bug. But they are not mandatory.
77+
// A Compilation is made up of a sketch (or a path to a sketch) and an fqbn.
78+
// Eventual libraries are automatically determined and linked.
79+
// NOTE: swagger will force you to define the files inside the sketch because of a bug. But they are not mandatory.
7680
type Compilation struct {
7781
// The fully qualified board name
7882
Fqbn string `form:"fqbn" json:"fqbn" xml:"fqbn"`
@@ -275,7 +279,8 @@ func (ut *filemeta) Publicize() *Filemeta {
275279
return &pub
276280
}
277281

278-
// FileMeta represent a file in the filesystem, belonging to a sketch, a library or an example. Can contain a data property with the content of the file.
282+
// FileMeta represent a file in the filesystem, belonging to a sketch, a library or an example.
283+
// Can contain a data property with the content of the file.
279284
type Filemeta struct {
280285
// The contents of the file, in base64
281286
Data *string `form:"data,omitempty" json:"data,omitempty" xml:"data,omitempty"`
@@ -291,7 +296,9 @@ func (ut *Filemeta) Validate() (err error) {
291296
return
292297
}
293298

294-
// Library is a collection of header files containing arduino reusable code and functions. It typically contains its info in a library.properties files. The examples property contains a list of examples that use that library.
299+
// Library is a collection of header files containing arduino reusable code and functions.
300+
// It typically contains its info in a library.properties files.
301+
// The examples property contains a list of examples that use that library.
295302
type library struct {
296303
// The architectures supported by the library.
297304
Architectures []string `form:"architectures,omitempty" json:"architectures,omitempty" xml:"architectures,omitempty"`
@@ -391,7 +398,9 @@ func (ut *library) Publicize() *Library {
391398
return &pub
392399
}
393400

394-
// Library is a collection of header files containing arduino reusable code and functions. It typically contains its info in a library.properties files. The examples property contains a list of examples that use that library.
401+
// Library is a collection of header files containing arduino reusable code and functions.
402+
// It typically contains its info in a library.properties files.
403+
// The examples property contains a list of examples that use that library.
395404
type Library struct {
396405
// The architectures supported by the library.
397406
Architectures []string `form:"architectures,omitempty" json:"architectures,omitempty" xml:"architectures,omitempty"`
@@ -468,7 +477,9 @@ type PinnedLib struct {
468477
Version *string `form:"version,omitempty" json:"version,omitempty" xml:"version,omitempty"`
469478
}
470479

471-
// A sketch is a program intended to run on an arduino board. It's composed by a main .ino file and optional other files. You should upload only .ino and .h files.
480+
// A sketch is a program intended to run on an arduino board.
481+
// It's composed by a main .ino file and optional other files.
482+
// You should upload only .ino and .h files.
472483
type sketch struct {
473484
// Other files contained in the example
474485
Files []*filefull `form:"files,omitempty" json:"files,omitempty" xml:"files,omitempty"`
@@ -527,7 +538,8 @@ func (ut *sketch) Publicize() *Sketch {
527538
return &pub
528539
}
529540

530-
// A sketch is a program intended to run on an arduino board. It's composed by a main .ino file and optional other files. You should upload only .ino and .h files.
541+
// A sketch is a program intended to run on an arduino board.
542+
// It's composed by a main .ino file and optional other files. You should upload only .ino and .h files.
531543
type Sketch struct {
532544
// Other files contained in the example
533545
Files []*Filefull `form:"files,omitempty" json:"files,omitempty" xml:"files,omitempty"`

Diff for: commands/board/attach.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ func initAttachCommand() *cobra.Command {
4646
Args: cobra.RangeArgs(1, 2),
4747
Run: runAttachCommand,
4848
}
49-
attachCommand.Flags().StringVar(&attachFlags.boardFlavour, "flavour", "default", "The Name of the CPU flavour, it is required for some boards (e.g. Arduino Nano).")
50-
attachCommand.Flags().StringVar(&attachFlags.searchTimeout, "timeout", "5s", "The timeout of the search of connected devices, try to high it if your board is not found (e.g. to 10s).")
49+
attachCommand.Flags().StringVar(&attachFlags.boardFlavour, "flavour", "default",
50+
"The Name of the CPU flavour, it is required for some boards (e.g. Arduino Nano).")
51+
attachCommand.Flags().StringVar(&attachFlags.searchTimeout, "timeout", "5s",
52+
"The timeout of the search of connected devices, try to high it if your board is not found (e.g. to 10s).")
5153
return attachCommand
5254
}
5355

Diff for: commands/board/list.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ func initListCommand() *cobra.Command {
3939
Args: cobra.NoArgs,
4040
Run: runListCommand,
4141
}
42-
listCommand.Flags().StringVar(&listFlags.timeout, "timeout", "5s", "The timeout of the search of connected devices, try to high it if your board is not found (e.g. to 10s).")
42+
usage := "The timeout of the search of connected devices, try to high it if your board is not found (e.g. to 10s)."
43+
listCommand.Flags().StringVar(&listFlags.timeout, "timeout", "5s", usage)
4344
return listCommand
4445
}
4546

0 commit comments

Comments
 (0)