Skip to content

Commit

Permalink
appease golint
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-perugini committed Sep 11, 2023
1 parent ce5276c commit 1dc6fcc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
10 changes: 5 additions & 5 deletions arduino/builder/compilation/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ var tr = i18n.Tr

// Database keeps track of all the compile commands run by the builder
type Database struct {
Contents []CompilationCommand
Contents []Command
File *paths.Path
}

// CompilationCommand keeps track of a single run of a compile command
type CompilationCommand struct {
// Command keeps track of a single run of a compile command
type Command struct {
Directory string `json:"directory"`
Command string `json:"command,omitempty"`
Arguments []string `json:"arguments,omitempty"`
Expand All @@ -45,7 +45,7 @@ type CompilationCommand struct {
func NewDatabase(filename *paths.Path) *Database {
return &Database{
File: filename,
Contents: []CompilationCommand{},
Contents: []Command{},
}
}

Expand Down Expand Up @@ -83,7 +83,7 @@ func (db *Database) Add(target *paths.Path, command *executils.Process) {
commandDir = dir
}

entry := CompilationCommand{
entry := Command{
Directory: commandDir,
Arguments: command.GetArgs(),
File: target.String(),
Expand Down
1 change: 1 addition & 0 deletions arduino/builder/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func (b *Builder) CoreBuildCachePath() *paths.Path {
return b.coreBuildCachePath
}

// CoreBuilder fixdoc
func CoreBuilder(
buildPath, coreBuildPath, coreBuildCachePath *paths.Path,
buildProperties *properties.Map,
Expand Down
12 changes: 8 additions & 4 deletions arduino/builder/libraries.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ import (
"github.com/pkg/errors"
)

var FLOAT_ABI_CFLAG = "float-abi"
var FPU_CFLAG = "fpu"
// nolint
var (
FloatAbiCflag = "float-abi"
FpuCflag = "fpu"
)

// LibrariesBuilder fixdoc
func LibrariesBuilder(
librariesBuildPath *paths.Path,
buildProperties *properties.Map,
Expand Down Expand Up @@ -87,7 +91,7 @@ func findExpectedPrecompiledLibFolder(
command, _ := utils.PrepareCommandForRecipe(buildProperties, "recipe.cpp.o.pattern", true)
fpuSpecs := ""
for _, el := range command.GetArgs() {
if strings.Contains(el, FPU_CFLAG) {
if strings.Contains(el, FpuCflag) {
toAdd := strings.Split(el, "=")
if len(toAdd) > 1 {
fpuSpecs += strings.TrimSpace(toAdd[1]) + "-"
Expand All @@ -96,7 +100,7 @@ func findExpectedPrecompiledLibFolder(
}
}
for _, el := range command.GetArgs() {
if strings.Contains(el, FLOAT_ABI_CFLAG) {
if strings.Contains(el, FloatAbiCflag) {
toAdd := strings.Split(el, "=")
if len(toAdd) > 1 {
fpuSpecs += strings.TrimSpace(toAdd[1]) + "-"
Expand Down
1 change: 1 addition & 0 deletions arduino/builder/linker.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/pkg/errors"
)

// Linker fixdoc
func Linker(
onlyUpdateCompilationDatabase bool,
sketchObjectFiles, librariesObjectFiles, coreObjectsFiles paths.PathList,
Expand Down
1 change: 1 addition & 0 deletions arduino/builder/sketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func writeIfDifferent(source []byte, destPath *paths.Path) error {
return nil
}

// SketchBuilder fixdoc
func SketchBuilder(
sketchBuildPath *paths.Path,
buildProperties *properties.Map,
Expand Down

0 comments on commit 1dc6fcc

Please sign in to comment.