arduino-cli
arduino-cli copied to clipboard
Add first set of `profile` commands
Please check if the PR fulfills these requirements
- [x] The PR has no duplicates (please search among the Pull Requests before creating one)
- [x] The PR follows our contributing guidelines
- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
- [ ]
UPGRADING.mdhas been updated with a migration guide (for breaking changes) - [ ]
configuration.schema.jsonupdated if new parameters are added.
What kind of change does this PR introduce?
Code enhancement
What is the current behavior?
Operations on the sketch.yaml project file must be done manually.
What is the new behavior?
First set of profile commands:
profile init [<PATH>] [-m <PROFILE_NAME -b <FQBN>] [--default]creates asketch.yamlfile at the provided path. By default it creates the file in the current directory. A new profile can be added to the file by providing a profile name and FQBN (mandatory). The platform is detected automatically. If there is only one profile, it is automatically set as the default profile, otherwise the flag--defaultmust be used. The command fails in the following cases:- the path does not exist or the main sketch file is missing
- the FQBN is wrong or the platform related to it is not installed locally
profile lib add <LIB_NAME@LIB_VERSION> [-m <PROFILE_NAME] [--dest-dir <PATH>]adds a library to the provided profile or to the default one. By default it checks for thesketch.yamlfile in the current directory.profile lib remove <LIB_NAME> [-m <PROFILE_NAME] [--dest-dir <PATH>]removes a library from the provided profile or from the default one. By default it checks for thesketch.yamlfile in the current directory.profile set-default <PROFILE_NAME> [--dest-dir <PATH>]sets the default profile to an existing profile. By default it checks for thesketch.yamlfile in the current directory.profile dump [<PATH>]dumps the content of thesketch.yamlfile. It supports theyamlandjsonformats.
Does this PR introduce a breaking change, and is titled accordingly?
Other information
Codecov Report
:x: Patch coverage is 66.25000% with 216 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 68.29%. Comparing base (20e315c) to head (65354c4).
Additional details and impacted files
@@ Coverage Diff @@
## master #2917 +/- ##
==========================================
- Coverage 68.36% 68.29% -0.08%
==========================================
Files 241 252 +11
Lines 22731 23328 +597
==========================================
+ Hits 15541 15932 +391
- Misses 5992 6166 +174
- Partials 1198 1230 +32
| Flag | Coverage Δ | |
|---|---|---|
| unit | 68.29% <66.25%> (-0.08%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Hello, this is great 🔥 Maybe you want to consider adding and removing multiple libs (later cores) with a single request. I do not know how it performs, but when a user interface wants to initialize a profile from a set of libraries and cores, one request would be better than multiple ones.
Update: I checked the changes only from the point of the proto API as a client.