-
-
Notifications
You must be signed in to change notification settings - Fork 423
Silence "config warnings" in text mode, except for config ...
commands
#2641
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@ ## master #2641 +/- ## ========================================== - Coverage 70.29% 70.28% -0.02% ========================================== Files 222 222 Lines 21308 21309 +1 ========================================== - Hits 14978 14976 -2 - Misses 5153 5155 +2 - Partials 1177 1178 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on ubuntu is working.
Is it intentional that when requesting the command below the json output omits the warnings
key, but when requesting with a subcommand different from config the warnings
key appears?
$ arduino-cli config get directories.data --json "/home/ale/.arduino15" $ arduino-cli version --format json { "Application": "arduino-cli", "Commit": "", "Date": "", "Status": "", "VersionString": "0.0.0-git", "warnings": [ "Invalid value in configuration: schema not defined for key 'asldfasdfasdf'" ] }
Is it intentional that when requesting the command below the json output omits the
warnings
key, but when requesting with a subcommand different from config thewarnings
key appears?
Yes, that's because the returned JSON is a string and there is no way to fit a warning
field inside.
We should have made it an object instead, like:
{ "value": "/home/ale/.arduino15", "warnings": [ "Invalid value in configuration: schema not defined for key 'asldfasdfasdf'" ] }
but now it's too late, it would be for CLI 2.0.0 :-)
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)configuration.schema.json
updated if new parameters are added.What kind of change does this PR introduce?
Prints configuration warnings in text mode only if running one of the
config ...
commands.Previously if there was an error in the configuration file, the warning was printed on all commands run from the cli.
In JSON mode the warning is always returned.
Also improve the error message from:
to
What is the current behavior?
What is the new behavior?
Does this PR introduce a breaking change, and is titled accordingly?
Other information
Partially fix #2638