cli code refactoring: argument parsing/handling should not access the arduino
package directly
#1948
Closed
16 tasks done
Labels
criticality: low
Of low impact
priority: high
Resolution is a high priority
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Milestone
Describe the problem
This is an architectural issue in the golang implementation of the CLI.
The
cli
package should not use directly thearduino
package but it should use only the functions available through gRPC, implemented in thecommands
package to avoid code duplication and re-implementation of the same functionality over and over.To reproduce
The current instances of the above issue are here:
internal/cli/arguments/completion.go
access the packagearduino/cores
:arduino-cli/internal/cli/arguments/completion.go
Line 21 in 82e6f5d
arduino-cli/internal/cli/arguments/completion.go
Line 106 in 82e6f5d
internal/cli/arguments/fqbn.go
access the packagesarduino/cores
andarduino/sketch
arduino-cli/internal/cli/arguments/fqbn.go
Lines 21 to 22 in 82e6f5d
sketch
:arduino-cli/internal/cli/arguments/fqbn.go
Line 73 in 82e6f5d
arduino
:arduino-cli/internal/cli/arguments/fqbn.go
Line 82 in 82e6f5d
arduino
:arduino-cli/internal/cli/arguments/fqbn.go
Line 86 in 82e6f5d
internal/cli/arguments/port.go
accessarduino/discovery
andarduino/sketch
arduino-cli/internal/cli/arguments/port.go
Lines 22 to 24 in 82e6f5d
sketch
:arduino-cli/internal/cli/arguments/port.go
Line 60 in 82e6f5d
sketch
:arduino-cli/internal/cli/arguments/port.go
Line 73 in 82e6f5d
arduino-cli/internal/cli/arguments/port.go
Lines 95 to 132 in 82e6f5d
cli/arguments/reference.go
usesarduino
to get an error object:arduino
:arduino-cli/internal/cli/arguments/reference.go
Line 123 in 82e6f5d
cli/arguments/sketch.go
usesarduino/sketch
:sketch
:arduino-cli/internal/cli/arguments/sketch.go
Lines 46 to 47 in 82e6f5d
sketch
:arduino-cli/internal/cli/arguments/sketch.go
Line 57 in 82e6f5d
Expected behavior
Remove all direct access to the
arduino
package using the gRPC commads implementation incommands
.Arduino CLI version
nightly build
Operating system
N/A
Operating system version
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: