10000 Added more lint checks and fixed some warnings. by cmaglie · Pull Request #2610 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content

Added more lint checks and fixed some warnings. #2610

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 5 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Removed unreachable code (impossible condition detected by linter)
internal/arduino/sketch/sketch.go:108:14: nilness: impossible condition: non-nil == nil (govet)
        if mainFile == nil {
                    ^
  • Loading branch information
cmaglie committed May 21, 2024
commit 24e5ce28c7294ede3cacfd576854ba7082fdb173
4 changes: 0 additions & 4 deletions internal/arduino/sketch/sketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ func New(path *paths.Path) (*Sketch, error) {
return nil, err
}

if mainFile == nil {
return nil, fmt.Errorf(tr("can't find main Sketch file in %s"), path)
}

sketchFolderFiles, err := sketch.supportedFiles()
if err != nil {
return nil, fmt.Errorf("%s: %w", tr("reading sketch files"), err)
Expand Down
5 changes: 3 additions & 2 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
logFormat string
jsonOutput bool
outputFormat string
configFile string
additionalUrls []string
)

Expand Down Expand Up @@ -179,10 +178,12 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
cmd.RegisterFlagCompletionFunc("format", cobra.FixedCompletions(validOutputFormats, cobra.ShellCompDirectiveDefault))
cmd.Flag("format").Hidden = true
cmd.PersistentFlags().BoolVar(&jsonOutput, "json", false, tr("Print the output in JSON format."))
cmd.PersistentFlags().StringVar(&configFile, "config-file", "", tr("The custom config file (if not specified the default will be used)."))
cmd.PersistentFlags().StringSliceVar(&additionalUrls, "additional-urls", defaultAdditionalURLs, tr("Comma-separated list of additional URLs for the Boards Manager."))
cmd.PersistentFlags().BoolVar(&noColor, "no-color", defaultOutputNoColor, "Disable colored output.")

// We are not using cobra to parse this flag, because we manually parse it in main.go.
// Just leaving it here so cobra will not complain about it.
cmd.PersistentFlags().String("config-file", "", tr("The custom config file (if not specified the default will be used)."))
return cmd
}

Expand Down
0