Skip to content

Commit ad5bff1

Browse files
Paolo Calaopolldo
Paolo Calao
authored andcommitted
Improve comments (#83)
Add a trailing dot at the end of comments on top of declarations
1 parent 8a61f4f commit ad5bff1

File tree

19 files changed

+36
-36
lines changed

19 files changed

+36
-36
lines changed

Diff for: arduino/commander.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
)
2323

2424
// Commander of arduino package allows to call
25-
// the arduino-cli commands in a programmatic way
25+
// the arduino-cli commands in a programmatic way.
2626
type Commander interface {
2727
BoardList() ([]*rpc.DetectedPort, error)
2828
UploadBin(fqbn, bin, port string) error

Diff for: arduino/dir.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"github.com/arduino/go-win32-utils"
2828
)
2929

30-
// DataDir returns the Arduino default data directory (arduino15)
30+
// DataDir returns the Arduino default data directory (arduino15).
3131
func DataDir() (*paths.Path, error) {
3232
userHomeDir, err := os.UserHomeDir()
3333
if err != nil {

Diff for: arduino/grpc/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type client struct {
4343
// NewClient instantiates and returns a new grpc client that allows to
4444
// programmatically call arduino-cli commands.
4545
// It exploits the grpc interface of the arduino-cli.
46-
// It returns: the client instance, a callback to close the client and an error
46+
// It returns: the client instance, a callback to close the client and an error.
4747
func NewClient() (arduino.Commander, func() error, error) {
4848
// Establish a connection with the gRPC server, started with the command:
4949
// arduino-cli daemon

Diff for: cli/version/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/spf13/cobra"
2626
)
2727

28-
// NewCommand created a new `version` command
28+
// NewCommand creates a new `version` command.
2929
func NewCommand() *cobra.Command {
3030
return &cobra.Command{
3131
Use: "version",

Diff for: command/dashboard/create.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type CreateParams struct {
3232
Template string // Path of the template file
3333
}
3434

35-
// Create allows to create a new dashboard
35+
// Create allows to create a new dashboard.
3636
func Create(params *CreateParams) (*DashboardInfo, error) {
3737
conf, err := config.Retrieve()
3838
if err != nil {

Diff for: command/device/board.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var (
3939
}
4040
)
4141

42-
// board contains details of a physical arduino board
42+
// board contains details of a physical arduino board.
4343
type board struct {
4444
fqbn string
4545
serial string
@@ -48,7 +48,7 @@ type board struct {
4848
}
4949

5050
// isCrypto checks if the board is a valid arduino board with a
51-
// supported crypto-chip
51+
// supported crypto-chip.
5252
func (b *board) isCrypto() bool {
5353
for _, f := range cryptoFQBN {
5454
if b.fqbn == f {
@@ -58,7 +58,7 @@ func (b *board) isCrypto() bool {
5858
return false
5959
}
6060

61-
// isCrypto checks if the board is a valid LoRa arduino board
61+
// isLora checks if the board is a valid LoRa arduino board.
6262
func (b *board) isLora() bool {
6363
for _, f := range loraFQBN {
6464
if b.fqbn == f {
@@ -94,8 +94,8 @@ func boardFromPorts(ports []*rpc.DetectedPort, params *CreateParams) *board {
9494
// - if the port parameter does not match the actual port address.
9595
// - if the the detected port does not contain any board.
9696
// It returns:
97-
// true -> to skip the port
98-
// false -> to keep the port
97+
// true -> to skip the port.
98+
// false -> to keep the port.
9999
func portFilter(port *rpc.DetectedPort, params *CreateParams) bool {
100100
if len(port.Boards) == 0 {
101101
return true

Diff for: command/device/createlora.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const (
4040
serialEUIBaudrate = 9600
4141

4242
// dev-eui is an IEEE EUI64 address, so it must have length of 8 bytes.
43-
// It's retrieved as hexadecimal string, thus 16 chars are expected
43+
// It's retrieved as hexadecimal string, thus 16 chars are expected.
4444
deveuiLength = 16
4545
)
4646

Diff for: command/device/provision.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func downloadProvisioningFile(fqbn string) (string, error) {
6464
}
6565

6666
// provision is responsible for running the provisioning
67-
// procedures for boards with crypto-chip
67+
// procedures for boards with crypto-chip.
6868
type provision struct {
6969
arduino.Commander
7070
iot.Client
@@ -73,7 +73,7 @@ type provision struct {
7373
id string
7474
}
7575

76-
// run provisioning procedure for boards with crypto-chip
76+
// run provisioning procedure for boards with crypto-chip.
7777
func (p provision) run() error {
7878
bin, err := downloadProvisioningFile(p.board.fqbn)
7979
if err != nil {

Diff for: command/ota/massupload.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type MassUploadParams struct {
4343
FQBN string
4444
}
4545

46-
// Result of an ota upload on a device
46+
// Result of an ota upload on a device.
4747
type Result struct {
4848
ID string
4949
Err error

Diff for: command/tag/create.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type CreateTagsParams struct {
3333
}
3434

3535
// CreateTags allows to create or overwrite tags
36-
// on a resource of Arduino IoT Cloud
36+
// on a resource of Arduino IoT Cloud.
3737
func CreateTags(params *CreateTagsParams) error {
3838
conf, err := config.Retrieve()
3939
if err != nil {

Diff for: command/tag/tag.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ package tag
1919

2020
import "fmt"
2121

22-
// TagsInfo transforms tags into user-readable strings
23-
// An error is returned if a tag value is not a string
22+
// TagsInfo transforms tags into user-readable strings.
23+
// An error is returned if a tag value is not a string.
2424
func TagsInfo(tags map[string]interface{}) ([]string, error) {
2525
var str []string
2626
for key, value := range tags {

Diff for: command/thing/clone.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type CloneParams struct {
3131
CloneID string // ID of thing to be cloned
3232
}
3333

34-
// Clone allows to create a new thing from an already existing one
34+
// Clone allows to create a new thing from an already existing one.
3535
func Clone(params *CloneParams) (*ThingInfo, error) {
3636
conf, err := config.Retrieve()
3737
if err != nil {

Diff for: command/thing/create.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type CreateParams struct {
3232
Template string // Path of the template file
3333
}
3434

35-
// Create allows to create a new thing
35+
// Create allows to create a new thing.
3636
func Create(params *CreateParams) (*ThingInfo, error) {
3737
conf, err := config.Retrieve()
3838
if err != nil {

Diff for: internal/binary/download.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
fwuploader "github.com/arduino/arduino-fwuploader/indexes/download"
2929
)
3030

31-
// Download a binary file contained in the binary index
31+
// Download a binary file contained in the binary index.
3232
func Download(bin *IndexBin) ([]byte, error) {
3333
b, err := download(bin.URL)
3434
if err != nil {

Diff for: internal/binary/index.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ import (
3030
)
3131

3232
const (
33-
// URL of cloud-team binary index
33+
// URL of cloud-team binary index.
3434
IndexGZURL = "https://cloud-downloads.arduino.cc/binaries/index.json.gz"
3535
IndexSigURL = "https://cloud-downloads.arduino.cc/binaries/index.json.sig"
3636
)
3737

3838
// Index contains details about all the binaries
39-
// loaded in 'cloud-downloads'
39+
// loaded in 'cloud-downloads'.
4040
type Index struct {
4141
Boards []IndexBoard `json:"boards"`
4242
}
4343

44-
// IndexBoard describes all the binaries available for a specific board
44+
// IndexBoard describes all the binaries available for a specific board.
4545
type IndexBoard struct {
4646
FQBN string `json:"fqbn"`
4747
Provision *IndexBin `json:"provision"`
4848
}
4949

50-
// IndexBin contains the details needed to retrieve a binary file from the cloud
50+
// IndexBin contains the details needed to retrieve a binary file from the cloud.
5151
type IndexBin struct {
5252
URL string `json:"url"`
5353
Checksum string `json:"checksum"`
@@ -95,7 +95,7 @@ func LoadIndex() (*Index, error) {
9595

9696
// FindProvisionBin looks for the provisioning binary corresponding
9797
// to the passed fqbn in the index.
98-
// Returns nil if the binary is not found
98+
// Returns nil if the binary is not found.
9999
func (i *Index) FindProvisionBin(fqbn string) *IndexBin {
100100
for _, b := range i.Boards {
101101
if b.FQBN == fqbn {

Diff for: internal/config/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
)
2727

2828
// Config contains all the configuration parameters
29-
// known by arduino-cloud-cli
29+
// known by arduino-cloud-cli.
3030
type Config struct {
3131
Client string `map-structure:"client"` // Client ID of the user
3232
Secret string `map-structure:"secret"` // Secret ID of the user, unique for each Client ID
@@ -78,7 +78,7 @@ func searchConfigDir() (string, error) {
7878
}
7979

8080
return "", fmt.Errorf(
81-
"didn't find config file in the current directory, its parents or in %s.",
81+
"didn't find config file in the current directory, its parents or in %s",
8282
arduino15.String(),
8383
)
8484
}

Diff for: internal/config/default.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var (
2323
Filename = "arduino-cloud"
2424
)
2525

26-
// SetDefaults sets the default values for configuration keys
26+
// SetDefaults sets the default values for configuration keys.
2727
func SetDefaults(settings *viper.Viper) {
2828
// Client ID
2929
settings.SetDefault("client", "xxxxxxxxxxxxxx")

Diff for: internal/serial/protocol.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@
1818
package serial
1919

2020
var (
21-
// msgStart is the initial byte sequence of every packet
21+
// msgStart is the initial byte sequence of every packet.
2222
msgStart = [2]byte{0x55, 0xAA}
23-
// msgEnd is the final byte sequence of every packet
23+
// msgEnd is the final byte sequence of every packet.
2424
msgEnd = [2]byte{0xAA, 0x55}
2525
)
2626

2727
const (
28-
// Position of payload field
28+
// payloadField indicates the position of payload field.
2929
payloadField = 5
30-
// Position of payload length field
30+
// payloadLenField indicates the position of payload length field.
3131
payloadLenField = 3
32-
// Length of payload length field
32+
// payloadLenFieldLen indicatest the length of payload length field.
3333
payloadLenFieldLen = 2
34-
// Length of the signature field
34+
// crcFieldLen indicates the length of the signature field.
3535
crcFieldLen = 2
3636
)
3737

38-
// MsgType indicates the type of the packet
38+
// MsgType indicates the type of the packet.
3939
type MsgType byte
4040

4141
const (

Diff for: internal/serial/serial.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (s *Serial) receive() ([]byte, error) {
147147
return payload, nil
148148
}
149149

150-
// encode is internally used to create a valid provisioning packet
150+
// encode is internally used to create a valid provisioning packet.
151151
func encode(mType MsgType, msg []byte) []byte {
152152
// Insert the preamble sequence followed by the message type
153153
packet := append(msgStart[:], byte(mType))

0 commit comments

Comments
 (0)