Skip to content

Fix typos in comments and messages #73

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 1 commit into from
Dec 1, 2020
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 check/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func RunChecks(project project.Type) {
continue
}

// Output will be printed after all checks are finished when configured for "json" output format
// Output will be printed after all checks are finished when configured for "json" output format.
feedback.Printf("Running check %s: ", checkConfiguration.ID)

checkResult, checkOutput := checkConfiguration.CheckFunction()
Expand Down
2 changes: 1 addition & 1 deletion check/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func Test_shouldRun(t *testing.T) {
{"Disable mode default", projecttype.Library, projecttype.Library, []checkmode.Type{checkmode.Default}, []checkmode.Type{checkmode.LibraryManagerSubmission}, "update", "specification", assert.False, assert.NoError},
{"Disable mode default override", projecttype.Library, projecttype.Library, []checkmode.Type{checkmode.Default}, []checkmode.Type{checkmode.LibraryManagerSubmission}, "submit", "specification", assert.True, assert.NoError},
{"Enable mode default", projecttype.Library, projecttype.Library, []checkmode.Type{checkmode.LibraryManagerSubmission}, []checkmode.Type{checkmode.Default}, "update", "specification", assert.True, assert.NoError},
{"Disable mode default override", projecttype.Library, projecttype.Library, []checkmode.Type{checkmode.LibraryManagerSubmission}, []checkmode.Type{checkmode.Default}, "submit", "specification", assert.False, assert.NoError},
{"Enable mode default override", projecttype.Library, projecttype.Library, []checkmode.Type{checkmode.LibraryManagerSubmission}, []checkmode.Type{checkmode.Default}, "submit", "specification", assert.False, assert.NoError},
{"Unable to resolve", projecttype.Library, projecttype.Library, []checkmode.Type{checkmode.LibraryManagerSubmission}, []checkmode.Type{checkmode.LibraryManagerIndexed}, "false", "specification", assert.False, assert.Error},
}

Expand Down
20 changes: 10 additions & 10 deletions check/checkconfigurations/checkconfigurations.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ var configurations = []Type{
ID: "",
Brief: "name < min length",
Description: "",
MessageTemplate: "library.properties name value is less than minimum length",
MessageTemplate: "library.properties name value is less than minimum length.",
DisableModes: nil,
EnableModes: []checkmode.Type{checkmode.All},
InfoModes: nil,
Expand All @@ -168,7 +168,7 @@ var configurations = []Type{
ID: "",
Brief: "name > max length",
Description: "",
MessageTemplate: "library.properties name value {{.}} is longer than maximum length",
MessageTemplate: "library.properties name value {{.}} is longer than maximum length.",
DisableModes: nil,
EnableModes: []checkmode.Type{checkmode.All},
InfoModes: nil,
Expand All @@ -183,7 +183,7 @@ var configurations = []Type{
ID: "",
Brief: "name > recommended length",
Description: "",
MessageTemplate: "library.properties name value {{.}} is longer than recommended max length",
MessageTemplate: "library.properties name value {{.}} is longer than recommended max length.",
DisableModes: nil,
EnableModes: []checkmode.Type{checkmode.All},
InfoModes: nil,
Expand Down Expand Up @@ -227,7 +227,7 @@ var configurations = []Type{
Subcategory: "name field",
ID: "",
Brief: `starts with "Arduino"`,
Description: `Case insensitive. 3rd party libraries added to Library Manager index prior to the enactment of this rule are "grandfathered"`,
Description: `Case insensitive. 3rd party libraries added to Library Manager index prior to the enactment of this rule are "grandfathered".`,
MessageTemplate: `Library name {{.}} starts with "Arduino". These names are reserved for official libraries.`,
DisableModes: []checkmode.Type{checkmode.Official},
EnableModes: []checkmode.Type{checkmode.Default},
Expand Down Expand Up @@ -393,7 +393,7 @@ var configurations = []Type{
ID: "",
Brief: "author < min length",
Description: "",
MessageTemplate: "library.properties author value is less than minimum length",
MessageTemplate: "library.properties author value is less than minimum length.",
DisableModes: nil,
EnableModes: []checkmode.Type{checkmode.All},
InfoModes: nil,
Expand Down Expand Up @@ -423,7 +423,7 @@ var configurations = []Type{
ID: "",
Brief: "maintainer < min length",
Description: "",
MessageTemplate: "library.properties maintainer value is less than minimum length",
MessageTemplate: "library.properties maintainer value is less than minimum length.",
DisableModes: nil,
EnableModes: []checkmode.Type{checkmode.All},
InfoModes: nil,
Expand Down Expand Up @@ -468,7 +468,7 @@ var configurations = []Type{
ID: "",
Brief: "email < min length",
Description: "",
MessageTemplate: "library.properties email value is less than minimum length",
MessageTemplate: "library.properties email value is less than minimum length.",
DisableModes: nil,
EnableModes: []checkmode.Type{checkmode.All},
InfoModes: nil,
Expand Down Expand Up @@ -513,7 +513,7 @@ var configurations = []Type{
ID: "",
Brief: "sentence < min length",
Description: "",
MessageTemplate: "library.properties sentence value is less than minimum length",
MessageTemplate: "library.properties sentence value is less than minimum length.",
DisableModes: nil,
EnableModes: []checkmode.Type{checkmode.All},
InfoModes: nil,
Expand Down Expand Up @@ -1052,8 +1052,8 @@ var configurations = []Type{
Subcategory: "",
ID: "SS001",
Brief: ".pde extension",
Description: "The .pde extension is used by both Processing sketches and Arduino sketches. Processing sketches should either be in the \"data\" subfolder of the sketch or in the \"extras\" folder of the library. Arduino sketches should use the modern .ino extension",
MessageTemplate: "{{.}} uses deprecated .pde file extension. Use .ino for Arduino sketches",
Description: "The .pde extension is used by both Processing sketches and Arduino sketches. Processing sketches should either be in the \"data\" subfolder of the sketch or in the \"extras\" folder of the library. Arduino sketches should use the modern .ino extension.",
MessageTemplate: "{{.}} uses deprecated .pde file extension. Use .ino for Arduino sketches.",
DisableModes: nil,
EnableModes: []checkmode.Type{checkmode.All},
InfoModes: nil,
Expand Down
2 changes: 1 addition & 1 deletion check/checkdata/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func InitializeForLibrary(project project.Type, schemasPath *paths.Path) {
}
}

if libraryManagerIndex == nil { // Only download the Library Manager index once
if libraryManagerIndex == nil { // Only download the Library Manager index once.
url := "http://downloads.arduino.cc/libraries/library_index.json"
httpResponse, err := http.Get(url)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions check/checkdata/schema/parsevalidationresult.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func ValidationErrorMatch(
schemasPath *paths.Path,
) bool {
if validationResult == nil {
// No error, so nothing to match
// No error, so nothing to match.
logrus.Trace("Schema validation passed. No match is possible.")
return false
}
Expand Down Expand Up @@ -140,7 +140,7 @@ func validationErrorSchemaPointerMatch(
}

// The schema validator does not provide full pointer past logic inversion keywords to the lowest level keywords related to the validation error cause.
// Therefore the sub-keywords must be checked for matches in order to be able to interpret the exact cause of the failure.
// Therefore, the sub-keywords must be checked for matches in order to be able to interpret the exact cause of the failure.
if regexp.MustCompile("(/not)|(/oneOf)$").MatchString(validationError.SchemaPtr) {
return validationErrorSchemaSubPointerMatch(schemaPointerRegexp, validationError.SchemaPtr, validationErrorSchemaPointerValue(validationError, schemasPath))
}
Expand Down
2 changes: 1 addition & 1 deletion check/checkdata/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func pathURI(path *paths.Path) string {
return pathURI.String()
}

// logValidationError logs the schema validation error data
// logValidationError logs the schema validation error data.
func logValidationError(validationError *jsonschema.ValidationError, schemasPath *paths.Path) {
logrus.Trace("--------Schema validation failure cause--------")
logrus.Tracef("Error message: %s", validationError.Error())
Expand Down
8 changes: 4 additions & 4 deletions check/checkfunctions/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ func LibraryPropertiesEmailFieldAsMaintainerAlias() (result checkresult.Type, ou
return checkresult.Pass, ""
}

// LibraryPropertiesNameFieldLTMinLength checks if the library.properties "email" value is less than the minimum length.
// LibraryPropertiesEmailFieldLTMinLength checks if the library.properties "email" value is less than the minimum length.
func LibraryPropertiesEmailFieldLTMinLength() (result checkresult.Type, output string) {
if checkdata.LibraryPropertiesLoadError() != nil {
return checkresult.NotRun, ""
Expand All @@ -476,7 +476,7 @@ func LibraryPropertiesEmailFieldLTMinLength() (result checkresult.Type, output s
return checkresult.Pass, ""
}

// LibraryPropertiesMaintainerFieldStartsWithArduino checks if the library.properties "email" value starts with "Arduino".
// LibraryPropertiesEmailFieldStartsWithArduino checks if the library.properties "email" value starts with "Arduino".
func LibraryPropertiesEmailFieldStartsWithArduino() (result checkresult.Type, output string) {
if checkdata.LibraryPropertiesLoadError() != nil {
return checkresult.NotRun, ""
Expand Down Expand Up @@ -682,7 +682,7 @@ func LibraryPropertiesArchitecturesFieldMissing() (result checkresult.Type, outp
return checkresult.Pass, ""
}

// LibraryPropertiesNameFieldLTMinLength checks if the library.properties "architectures" value is less than the minimum length.
// LibraryPropertiesArchitecturesFieldLTMinLength checks if the library.properties "architectures" value is less than the minimum length.
func LibraryPropertiesArchitecturesFieldLTMinLength() (result checkresult.Type, output string) {
if checkdata.LibraryPropertiesLoadError() != nil {
return checkresult.NotRun, ""
Expand Down Expand Up @@ -782,7 +782,7 @@ func LibraryPropertiesDotALinkageFieldTrueWithFlatLayout() (result checkresult.T
return checkresult.Pass, ""
}

// LibraryPropertiesNameFieldLTMinLength checks if the library.properties "includes" value is less than the minimum length.
// LibraryPropertiesIncludesFieldLTMinLength checks if the library.properties "includes" value is less than the minimum length.
func LibraryPropertiesIncludesFieldLTMinLength() (result checkresult.Type, output string) {
if checkdata.LibraryPropertiesLoadError() != nil {
return checkresult.NotRun, ""
Expand Down
2 changes: 1 addition & 1 deletion command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/spf13/cobra"
)

// arduinoCheck is the root command function.
// ArduinoCheck is the root command function.
func ArduinoCheck(rootCommand *cobra.Command, cliArguments []string) {
if err := configuration.Initialize(rootCommand.Flags(), cliArguments); err != nil {
feedback.Errorf("Configuration error: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func CheckModes(superprojectType projecttype.Type) map[checkmode.Type]bool {

var superprojectTypeFilter projecttype.Type

// SuperprojectType returns the superproject type filter configuration.
// SuperprojectTypeFilter returns the superproject type filter configuration.
func SuperprojectTypeFilter() projecttype.Type {
return superprojectTypeFilter
}
Expand Down
4 changes: 2 additions & 2 deletions configuration/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"github.com/arduino/arduino-check/project/projecttype"
)

// Default check modes for each superproject type
// Subprojects use the same check modes as the superproject
// Default check modes for each superproject type.
// Subprojects use the same check modes as the superproject.
var defaultCheckModes = map[projecttype.Type]map[checkmode.Type]bool{
projecttype.Sketch: {
checkmode.Permissive: false,
Expand Down
2 changes: 1 addition & 1 deletion project/library/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var examplesFolderSupportedNames = map[string]struct{}{
"example": empty,
}

// ExamplesFolderNames returns a slice of supported examples folder names
// ExamplesFolderSupportedNames returns a slice of supported examples folder names
func ExamplesFolderSupportedNames() []string {
folderNames := make([]string, 0, len(examplesFolderSupportedNames))
for folderName := range examplesFolderSupportedNames {
Expand Down
2 changes: 1 addition & 1 deletion project/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// To purchase a commercial license, send an email to license@arduino.cc.

/*
Package packageindex provides functions specific to checking Arduino boards platforms.
Package platform provides functions specific to checking Arduino boards platforms.
See: https://arduino.github.io/arduino-cli/latest/platform-specification/
*/
package platform
Expand Down
4 changes: 2 additions & 2 deletions project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func findSubprojects(superproject Type, apexSuperprojectType projecttype.Type) [
panic(fmt.Sprintf("Subproject discovery not configured for project type: %s", superproject.ProjectType))
}

// Search the subproject paths for projects
// Search the subproject paths for projects.
var immediateSubprojects []Type
for _, subprojectFolderName := range subprojectFolderNames {
subprojectPath := superproject.Path.Join(subprojectFolderName)
Expand Down Expand Up @@ -186,7 +186,7 @@ func isProject(potentialProjectPath *paths.Path, projectTypeFilter projecttype.T
return true, projectType
}

// isProject determines if a file is the indicator file for an Arduino project, and if so which type.
// isProjectIndicatorFile determines if a file is the indicator file for an Arduino project, and if so which type.
func isProjectIndicatorFile(potentialProjectFilePath *paths.Path, projectTypeFilter projecttype.Type) (bool, projecttype.Type) {
logrus.Tracef("Checking if %s is %s indicator file", potentialProjectFilePath, projectTypeFilter)

Expand Down
2 changes: 1 addition & 1 deletion project/projecttype/projecttype.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func FromString(projectTypeString string) (Type, error) {
return Not, fmt.Errorf("No matching project type for string %s", projectTypeString)
}

// Matches returns whether the receiver project type matches the argument project type
// Matches returns whether the receiver project type matches the argument project type.
func (projectTypeA Type) Matches(projectTypeB Type) bool {
if projectTypeA == Not && projectTypeB == Not {
return true
Expand Down
2 changes: 1 addition & 1 deletion result/outputformat/outputformat.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Arduino software without disclosing the source code of your own applications.
// To purchase a commercial license, send an email to license@arduino.cc.

// Package projecttype defines the output formats
// Package outputformat defines the output formats
package outputformat

import (
Expand Down
2 changes: 1 addition & 1 deletion result/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (results *Type) Record(checkedProject project.Type, checkConfiguration chec
},
)
} else {
// There's already a report for this project, just add the checks report to it
// There's already a report for this project; just add the checks report to it.
results.Projects[projectReportIndex].Checks = append(results.Projects[projectReportIndex].Checks, checkReport)
}

Expand Down