Skip to content

Minor code documentation enhancements #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arduino/cores/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
// Tool represents a single Tool, part of a Package.
type Tool struct {
Name string `json:"name,required"` // The Name of the Tool.
Releases map[string]*ToolRelease `json:"releases"` //Maps Version to Release.
Releases map[string]*ToolRelease `json:"releases"` // Maps Version to Release.
Package *Package `json:"-"`
}

Expand Down
2 changes: 1 addition & 1 deletion builder_client_helpers/alive.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *Client) PingAlive(ctx context.Context, path string) (*http.Response, er
return c.Client.Do(ctx, req)
}

// NewPingAliveRequest create the request corresponding to the ping action endpoint of the alive resource.
// NewPingAliveRequest creates the request corresponding to the ping action endpoint of the alive resource.
func (c *Client) NewPingAliveRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down
4 changes: 2 additions & 2 deletions builder_client_helpers/boards.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *Client) ListBoards(ctx context.Context, path string) (*http.Response, e
return c.Client.Do(ctx, req)
}

// NewListBoardsRequest create the request corresponding to the list action endpoint of the boards resource.
// NewListBoardsRequest creates the request corresponding to the list action endpoint of the boards resource.
func (c *Client) NewListBoardsRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down Expand Up @@ -69,7 +69,7 @@ func (c *Client) ShowBoards(ctx context.Context, path string) (*http.Response, e
return c.Client.Do(ctx, req)
}

// NewShowBoardsRequest create the request corresponding to the show action endpoint of the boards resource.
// NewShowBoardsRequest creates the request corresponding to the show action endpoint of the boards resource.
func (c *Client) NewShowBoardsRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down
12 changes: 6 additions & 6 deletions builder_client_helpers/boards_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func ByVidPidBoardsV2Path(vid string, pid string) string {
return fmt.Sprintf("/builder/v2/boards/byVidPid/%s/%s", param0, param1)
}

// Provides the board identified by the :vid and :pid params. Doesn't require authentication.
// ByVidPidBoardsV2 provides the board identified by the :vid and :pid params. Doesn't require authentication.
func (c *Client) ByVidPidBoardsV2(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewByVidPidBoardsV2Request(ctx, path)
if err != nil {
Expand All @@ -42,7 +42,7 @@ func (c *Client) ByVidPidBoardsV2(ctx context.Context, path string) (*http.Respo
return c.Client.Do(ctx, req)
}

// NewByVidPidBoardsV2Request create the request corresponding to the byVidPid action endpoint of the boards_v2 resource.
// NewByVidPidBoardsV2Request creates the request corresponding to the byVidPid action endpoint of the boards_v2 resource.
func (c *Client) NewByVidPidBoardsV2Request(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand All @@ -62,7 +62,7 @@ func ListBoardsV2Path() string {
return fmt.Sprintf("/builder/v2/boards")
}

// Provides a list of all the boards supported by Arduino Create. Doesn't require any authentication.
// ListBoardsV2 provides a list of all the boards supported by Arduino Create. Doesn't require any authentication.
func (c *Client) ListBoardsV2(ctx context.Context, path string, limit *int, offset *int) (*http.Response, error) {
req, err := c.NewListBoardsV2Request(ctx, path, limit, offset)
if err != nil {
Expand All @@ -71,7 +71,7 @@ func (c *Client) ListBoardsV2(ctx context.Context, path string, limit *int, offs
return c.Client.Do(ctx, req)
}

// NewListBoardsV2Request create the request corresponding to the list action endpoint of the boards_v2 resource.
// NewListBoardsV2Request creates the request corresponding to the list action endpoint of the boards_v2 resource.
func (c *Client) NewListBoardsV2Request(ctx context.Context, path string, limit *int, offset *int) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down Expand Up @@ -102,7 +102,7 @@ func ShowBoardsV2Path(fqbn string) string {
return fmt.Sprintf("/builder/v2/boards/%s", param0)
}

// Provides the board identified by an fqbn. Doesn't require authentication.
// ShowBoardsV2 provides the board identified by an fqbn. Doesn't require authentication.
func (c *Client) ShowBoardsV2(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewShowBoardsV2Request(ctx, path)
if err != nil {
Expand All @@ -111,7 +111,7 @@ func (c *Client) ShowBoardsV2(ctx context.Context, path string) (*http.Response,
return c.Client.Do(ctx, req)
}

// NewShowBoardsV2Request create the request corresponding to the show action endpoint of the boards_v2 resource.
// NewShowBoardsV2Request creates the request corresponding to the show action endpoint of the boards_v2 resource.
func (c *Client) NewShowBoardsV2Request(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down
2 changes: 1 addition & 1 deletion builder_client_helpers/compilations.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (c *Client) StartCompilations(ctx context.Context, path string, payload *Co
return c.Client.Do(ctx, req)
}

// NewStartCompilationsRequest create the request corresponding to the start action endpoint of the compilations resource.
// NewStartCompilationsRequest creates the request corresponding to the start action endpoint of the compilations resource.
func (c *Client) NewStartCompilationsRequest(ctx context.Context, path string, payload *Compilation) (*http.Request, error) {
var body bytes.Buffer
err := c.Encoder.Encode(payload, &body, "*/*")
Expand Down
2 changes: 1 addition & 1 deletion builder_client_helpers/examples.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *Client) ListExamples(ctx context.Context, path string, maintainer *stri
return c.Client.Do(ctx, req)
}

// NewListExamplesRequest create the request corresponding to the list action endpoint of the examples resource.
// NewListExamplesRequest creates the request corresponding to the list action endpoint of the examples resource.
func (c *Client) NewListExamplesRequest(ctx context.Context, path string, maintainer *string, libType *string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down
2 changes: 1 addition & 1 deletion builder_client_helpers/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (c *Client) ShowFiles(ctx context.Context, path string) (*http.Response, er
return c.Client.Do(ctx, req)
}

// NewShowFilesRequest create the request corresponding to the show action endpoint of the files resource.
// NewShowFilesRequest creates the request corresponding to the show action endpoint of the files resource.
func (c *Client) NewShowFilesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down
6 changes: 3 additions & 3 deletions builder_client_helpers/libraries.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (c *Client) ListLibraries(
return c.Client.Do(ctx, req)
}

// NewListLibrariesRequest create the request corresponding to the list action endpoint of the libraries resource.
// NewListLibrariesRequest creates the request corresponding to the list action endpoint of the libraries resource.
func (c *Client) NewListLibrariesRequest(ctx context.Context, path string, maintainer *string, libType *string, withoutType *string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down Expand Up @@ -73,7 +73,7 @@ func ShowLibrariesPath(id string) string {
}

// 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
// Also contains a list of other versions of the library.
func (c *Client) ShowLibraries(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewShowLibrariesRequest(ctx, path)
if err != nil {
Expand All @@ -82,7 +82,7 @@ func (c *Client) ShowLibraries(ctx context.Context, path string) (*http.Response
return c.Client.Do(ctx, req)
}

// NewShowLibrariesRequest create the request corresponding to the show action endpoint of the libraries resource.
// NewShowLibrariesRequest creates the request corresponding to the show action endpoint of the libraries resource.
func (c *Client) NewShowLibrariesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down
12 changes: 6 additions & 6 deletions builder_client_helpers/pinned_libraries.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func AddPinnedLibrariesPath(id string) string {
return fmt.Sprintf("/builder/pinned/%s", param0)
}

//AddPinnedLibraries adds a new library to the list of libraries pinned by the user
// AddPinnedLibraries adds a new library to the list of libraries pinned by the user
func (c *Client) AddPinnedLibraries(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewAddPinnedLibrariesRequest(ctx, path)
if err != nil {
Expand All @@ -40,7 +40,7 @@ func (c *Client) AddPinnedLibraries(ctx context.Context, path string) (*http.Res
return c.Client.Do(ctx, req)
}

// NewAddPinnedLibrariesRequest create the request
// NewAddPinnedLibrariesRequest creates the request
// corresponding to the add action endpoint of the pinnedLibraries resource.
func (c *Client) NewAddPinnedLibrariesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
Expand All @@ -63,7 +63,7 @@ func ListPinnedLibrariesPath() string {
return fmt.Sprintf("/builder/pinned")
}

//ListPinnedLibraries provides a list of all the libraries pinned by the user
// ListPinnedLibraries provides a list of all the libraries pinned by the user
func (c *Client) ListPinnedLibraries(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewListPinnedLibrariesRequest(ctx, path)
if err != nil {
Expand All @@ -72,7 +72,7 @@ func (c *Client) ListPinnedLibraries(ctx context.Context, path string) (*http.Re
return c.Client.Do(ctx, req)
}

// NewListPinnedLibrariesRequest create the request corresponding to the list action endpoint of the pinnedLibraries resource.
// NewListPinnedLibrariesRequest creates the request corresponding to the list action endpoint of the pinnedLibraries resource.
func (c *Client) NewListPinnedLibrariesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand All @@ -96,7 +96,7 @@ func RemovePinnedLibrariesPath(id string) string {
return fmt.Sprintf("/builder/pinned/%s", param0)
}

//RemovePinnedLibraries removes a library to the list of libraries pinned by the user
// RemovePinnedLibraries removes a library to the list of libraries pinned by the user
func (c *Client) RemovePinnedLibraries(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewRemovePinnedLibrariesRequest(ctx, path)
if err != nil {
Expand All @@ -105,7 +105,7 @@ func (c *Client) RemovePinnedLibraries(ctx context.Context, path string) (*http.
return c.Client.Do(ctx, req)
}

// NewRemovePinnedLibrariesRequest create the request corresponding to the remove action endpoint of the pinnedLibraries resource.
// NewRemovePinnedLibrariesRequest creates the request corresponding to the remove action endpoint of the pinnedLibraries resource.
func (c *Client) NewRemovePinnedLibrariesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down
2 changes: 1 addition & 1 deletion commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func InitPackageManager() *packagemanager.PackageManager {
return pm
}

// InitLibraryManager initialize the LibraryManager using the underlying packagemanager
// InitLibraryManager initializes the LibraryManager using the underlying packagemanager
func InitLibraryManager(pm *packagemanager.PackageManager) *librariesmanager.LibrariesManager {
logrus.Info("Starting libraries manager")
lm := librariesmanager.NewLibraryManager(
Expand Down
2 changes: 1 addition & 1 deletion commands/generatedocs/generatedocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func generateBashCompletions(cmd *cobra.Command, args []string) {
}
}

// Generate man pages for all commands and puts them in $PROJECT_DIR/docs/manpages.
// Generates man pages for all commands and puts them in $PROJECT_DIR/docs/manpages.
func generateManPages(cmd *cobra.Command, args []string) {
if outputDir == "" {
outputDir = "docs/manpages"
Expand Down
4 changes: 2 additions & 2 deletions common/formatter/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ var test TestType{

var testString = a.Format(test)
fmt.Println(testString) // Prints test.String()
a.Print(test) //does the same.
a.Print(test) // Does the same.

testString = b.Format(test)
fmt.Println(testString) // Prints { field1 : "test", field2 : "42" }
b.Print(test) //Does the same
b.Print(test) // Does the same
----

=== The default formatter
Expand Down
2 changes: 1 addition & 1 deletion common/formatter/output/common_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"strings"
)

//ProcessResult contains info about a completed process.
// ProcessResult contains info about a completed process.
type ProcessResult struct {
ItemName string `json:"name,required"`
Status string `json:"status,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions create_client_helpers/alive.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func PingAlivePath() string {
return fmt.Sprintf("/create/alive")
}

// Returns 200 if the instance is healthy
// Returns 200 if the instance is healthy.
func (c *Client) PingAlive(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewPingAliveRequest(ctx, path)
if err != nil {
Expand All @@ -39,7 +39,7 @@ func (c *Client) PingAlive(ctx context.Context, path string) (*http.Response, er
return c.Client.Do(ctx, req)
}

// NewPingAliveRequest create the request corresponding to the ping action endpoint of the alive resource.
// NewPingAliveRequest creates the request corresponding to the ping action endpoint of the alive resource.
func (c *Client) NewPingAliveRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down
4 changes: 2 additions & 2 deletions create_client_helpers/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func ShowFilesPath(fileType string, id string, name string) string {
return fmt.Sprintf("/create/v1/files/%s/%s/%s", param0, param1, param2)
}

// Provides the content of the file identified by :name and :id
// ShowFiles provides the content of the file identified by :name and :id.
func (c *Client) ShowFiles(ctx context.Context, path string) (*http.Response, error) {
req, err := c.NewShowFilesRequest(ctx, path)
if err != nil {
Expand All @@ -42,7 +42,7 @@ func (c *Client) ShowFiles(ctx context.Context, path string) (*http.Response, er
return c.Client.Do(ctx, req)
}

// NewShowFilesRequest create the request corresponding to the show action endpoint of the files resource.
// NewShowFilesRequest creates the request corresponding to the show action endpoint of the files resource.
func (c *Client) NewShowFilesRequest(ctx context.Context, path string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down
20 changes: 10 additions & 10 deletions create_client_helpers/sketches.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (
prod = true
)

// CreateSketches Adds a new sketch.
// CreateSketches adds a new sketch.
func (c *Client) CreateSketches(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Response, error) {
req, err := c.NewCreateSketchesRequest(ctx, path, payload, authorization)
if err != nil {
Expand All @@ -45,7 +45,7 @@ func (c *Client) CreateSketches(ctx context.Context, path string, payload *Sketc
return c.Client.Do(ctx, req)
}

// NewCreateSketchesRequest create the request corresponding to the create action endpoint of the sketches resource.
// NewCreateSketchesRequest creates the request corresponding to the create action endpoint of the sketches resource.
func (c *Client) NewCreateSketchesRequest(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Request, error) {
var body bytes.Buffer
err := c.Encoder.Encode(payload, &body, "*/*")
Expand Down Expand Up @@ -79,7 +79,7 @@ func DeleteSketchesPath(id string) string {
return fmt.Sprintf("/create/v1/sketches/%s", id)
}

// DeleteSketches Removes the sketch identified by the :id param.
// DeleteSketches removes the sketch identified by the :id param.
func (c *Client) DeleteSketches(ctx context.Context, path string, authorization string) (*http.Response, error) {
req, err := c.NewDeleteSketchesRequest(ctx, path, authorization)
if err != nil {
Expand All @@ -88,7 +88,7 @@ func (c *Client) DeleteSketches(ctx context.Context, path string, authorization
return c.Client.Do(ctx, req)
}

// NewDeleteSketchesRequest create the request corresponding to the delete action endpoint of the sketches resource.
// NewDeleteSketchesRequest creates the request corresponding to the delete action endpoint of the sketches resource.
func (c *Client) NewDeleteSketchesRequest(ctx context.Context, path string, authorization string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down Expand Up @@ -118,7 +118,7 @@ func EditSketchesPath(id string) string {
return fmt.Sprintf("/create/v1/sketches/%s", param0)
}

// EditSketches Modifies the sketch identified by the :id param.
// EditSketches modifies the sketch identified by the :id param.
// If a file has a valid data field, it will be modified too.
func (c *Client) EditSketches(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Response, error) {
req, err := c.NewEditSketchesRequest(ctx, path, payload, authorization)
Expand All @@ -128,7 +128,7 @@ func (c *Client) EditSketches(ctx context.Context, path string, payload *Sketch,
return c.Client.Do(ctx, req)
}

// NewEditSketchesRequest create the request corresponding to the edit action endpoint of the sketches resource.
// NewEditSketchesRequest creates the request corresponding to the edit action endpoint of the sketches resource.
func (c *Client) NewEditSketchesRequest(ctx context.Context, path string, payload *Sketch, authorization string) (*http.Request, error) {
var body bytes.Buffer
err := c.Encoder.Encode(payload, &body, "*/*")
Expand Down Expand Up @@ -162,7 +162,7 @@ func SearchSketchesPath() string {
return fmt.Sprintf("/create/v1/sketches")
}

// SearchSketches Provides a paginated list of sketches filtered according to the params. The page size is 100 items.
// SearchSketches provides a paginated list of sketches filtered according to the params. The page size is 100 items.
func (c *Client) SearchSketches(ctx context.Context, path string, offset *string, owner *string, authorization *string) (*http.Response, error) {
req, err := c.NewSearchSketchesRequest(ctx, path, offset, owner, authorization)
if err != nil {
Expand All @@ -171,7 +171,7 @@ func (c *Client) SearchSketches(ctx context.Context, path string, offset *string
return c.Client.Do(ctx, req)
}

// NewSearchSketchesRequest create the request corresponding to the search action endpoint of the sketches resource.
// NewSearchSketchesRequest creates the request corresponding to the search action endpoint of the sketches resource.
func (c *Client) NewSearchSketchesRequest(ctx context.Context, path string, offset *string, owner *string, authorization *string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down Expand Up @@ -209,7 +209,7 @@ func ShowSketchesPath(id string) string {
return fmt.Sprintf("/create/v1/sketches/%s", param0)
}

// ShowSketches Provides the sketch identified by the :id param.
// ShowSketches provides the sketch identified by the :id param.
func (c *Client) ShowSketches(ctx context.Context, path string, authorization *string) (*http.Response, error) {
req, err := c.NewShowSketchesRequest(ctx, path, authorization)
if err != nil {
Expand All @@ -218,7 +218,7 @@ func (c *Client) ShowSketches(ctx context.Context, path string, authorization *s
return c.Client.Do(ctx, req)
}

// NewShowSketchesRequest create the request corresponding to the show action endpoint of the sketches resource.
// NewShowSketchesRequest creates the request corresponding to the show action endpoint of the sketches resource.
func (c *Client) NewShowSketchesRequest(ctx context.Context, path string, authorization *string) (*http.Request, error) {
scheme := c.Scheme
if scheme == "" {
Expand Down
2 changes: 1 addition & 1 deletion create_client_helpers/user_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type Sketch struct {
Types []string `form:"types,omitempty" json:"types,omitempty" xml:"types,omitempty"`
}

//ConvertFrom converts from a local sketch to an Arduino Create sketch.
// ConvertFrom converts from a local sketch to an Arduino Create sketch.
func ConvertFrom(sketch sketches.Sketch) *Sketch {
_, inoPath := filepath.Split(sketch.Ino.Path)
content, err := ioutil.ReadFile(filepath.Join(sketch.FullPath, inoPath))
Expand Down