-
-
Notifications
You must be signed in to change notification settings - Fork 398
Invalid JSON output for outdated command #2104
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
Comments
I looked into this (I was just curious) and the issue is that since the simplification of And while this works nicely for the text format, it does not produce valid JSON, because it just prints two separate JSON objects (in your example, an empty The fix that I can think of is refactor a bit the code so that @cmaglie, can you please comment on my suggestion? Thanks! |
Fixes issue arduino#2104 The code for `internal/cli/core` and `internal/cli/lib` has been refactored so that we can use only the `Get` functions from `internal/cli/outdated` package and compose there the table and JSON object. For regular text output, the new table will have some extra fields that either for platforms or for libraries will be blank. For JSON output, the resulting object will be an array of two arrays: the outdated platforms and the outdated libraries. Signed-off-by: Lluís Martínez <[email protected]>
Fixes issue arduino#2104 The code for `internal/cli/core` and `internal/cli/lib` has been refactored so that we can use only the `Get` functions from `internal/cli/outdated` package and compose there the table and JSON object. For regular text output, the new table will have some extra fields that either for platforms or for libraries will be blank. For JSON output, the resulting object will be an array of two arrays: the outdated platforms and the outdated libraries. Signed-off-by: Lluís Martínez <[email protected]>
That's correct, but I don't know how much refactoring is required to do so. I see that you made a PR already, I guess you tried implementing the idea above, I'll take a look at it ASAP. |
Fixes issue arduino#2104 The code for `internal/cli/core` and `internal/cli/lib` has been refactored so that we can use only the `Get` functions from `internal/cli/outdated` package and compose there the table and JSON object. For regular text output, the new table will have some extra fields that either for platforms or for libraries will be blank. For JSON output, the resulting object will be an array of two arrays: the outdated platforms and the outdated libraries. Signed-off-by: Lluís Martínez <[email protected]>
Fixes issue arduino#2104 The code for `internal/cli/core` and `internal/cli/lib` has been refactored so that we can use only the `Get` functions from `internal/cli/outdated` package and compose there the table and JSON object. For regular text output, the new table will have some extra fields that either for platforms or for libraries will be blank. For JSON output, the resulting object will be an array of two arrays: the outdated platforms and the outdated libraries. Signed-off-by: Lluís Martínez <[email protected]>
@cmaglie Thanks! Yes, I got started before your feedback as it seemed quite right. The PR is ready for review now 🔍 |
Fixes issue arduino#2104 The code for `internal/cli/core` and `internal/cli/lib` has been refactored so that we can use only the `Get` functions from `internal/cli/outdated` package and compose there composited object. For regular text output, the new table will have some extra fields that either for platforms or for libraries will be blank. For JSON and YAML output, the resulting object will have the top-level keys `platforms` and `libraries` which contain, respectively, the array of outaded platforms and outdated libraries. Signed-off-by: Lluís Martínez <[email protected]>
Fixes issue arduino#2104 The code for `internal/cli/core` and `internal/cli/lib` has been refactored so that we can use only the `Get` functions from `internal/cli/outdated` package and compose there composited object. For regular text output, the new table will have some extra fields that either for platforms or for libraries will be blank. For JSON and YAML output, the resulting object will have the top-level keys `platforms` and `libraries` which contain, respectively, the array of outaded platforms and outdated libraries. Signed-off-by: Lluís Martínez <[email protected]>
Fixes issue #2104 The code for `internal/cli/core` and `internal/cli/lib` has been refactored so that we can use only the `Get` functions from `internal/cli/outdated` package and compose there composited object. For regular text output, the new table will have some extra fields that either for platforms or for libraries will be blank. For JSON and YAML output, the resulting object will have the top-level keys `platforms` and `libraries` which contain, respectively, the array of outaded platforms and outdated libraries. Signed-off-by: Lluís Martínez <[email protected]>
Fixes issue arduino#2104 The code for `internal/cli/core` and `internal/cli/lib` has been refactored so that we can use only the `Get` functions from `internal/cli/outdated` package and compose there composited object. For regular text output, the new table will have some extra fields that either for platforms or for libraries will be blank. For JSON and YAML output, the resulting object will have the top-level keys `platforms` and `libraries` which contain, respectively, the array of outaded platforms and outdated libraries. Signed-off-by: Lluís Martínez <[email protected]>
Describe the problem
When running the
outdated
command with--format json
, the produced output is not valid JSON. It looks like it contains two arrays.To reproduce
Install an outdated library ie:
arduino-cli lib install "[email protected]"
Then run :
Which produces the following output :
Expected behavior
The output should be valid JSON.
Arduino CLI version
arduino-cli.exe Version: nightly-20230310 Commit: fed439a Date: 2023-03-10T01:35:49Z
Operating system
Windows
Operating system version
Windows 11 22H2
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: