Skip to content

Invalid JSON output for outdated command #2104

Closed
@Renaud11232

Description

@Renaud11232

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 :

arduino-cli --format json outdated

Which produces the following output :

[]
[
  {
    "library": {
      "name": "FastLED",
      "author": "Daniel Garcia",
      "maintainer": "Daniel Garcia \u003c[email protected]\u003e",
      "sentence": "Multi-platform library for controlling dozens of different types of LEDs along with optimized math, effect, and noise functions.",
      "paragraph": "Multi-platform library for controlling dozens of different types of LEDs along with optimized math, effect, and noise functions.",
      "website": "https://github.com/FastLED/FastLED",
      "category": "Display",
      "architectures": [
        "*"
      ],
      "install_dir": "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED",
      "source_dir": "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED",
      "version": "3.3.2",
      "license": "Unspecified",
      "location": 1,
      "examples": [
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\AnalogOutput",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Blink",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\ColorPalette",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\ColorTemperature",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Cylon",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\DemoReel100",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Fire2012",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Fire2012WithPalette",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\FirstLight",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Multiple\\ArrayOfLedArrays",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Multiple\\MirroringSample",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Multiple\\MultiArrays",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Multiple\\MultipleStripsInOneArray",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Multiple\\OctoWS2811Demo",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Multiple\\ParallelOutputDemo",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Noise",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\NoisePlayground",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\NoisePlusPalette",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Pintest",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\Ports\\PJRCSpectrumAnalyzer",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\RGBCalibrate",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\RGBSetDemo",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\SmartMatrix",
        "C:\\Users\\gaspa\\Documents\\Arduino\\libraries\\FastLED\\examples\\XYMatrix"
      ],
      "provides_includes": [
        "FastLED.h",
        "bitswap.h",
        "chipsets.h",
        "color.h",
        "colorpalettes.h",
        "colorutils.h",
        "controller.h",
        "cpp_compat.h",
        "dmx.h",
        "fastled_config.h",
        "fastled_delay.h",
        "fastled_progmem.h",
        "fastpin.h",
        "fastspi.h",
        "fastspi_bitbang.h",
        "fastspi_dma.h",
        "fastspi_nop.h",
        "fastspi_ref.h",
        "fastspi_types.h",
        "hsv2rgb.h",
        "led_sysdefs.h",
        "lib8tion.h",
        "noise.h",
        "pixelset.h",
        "pixeltypes.h",
        "platforms.h",
        "power_mgt.h"
      ]
    },
    "release": {
      "author": "Daniel Garcia",
      "version": "3.5.0",
      "maintainer": "Daniel Garcia \u003c[email protected]\u003e",
      "sentence": "Multi-platform library for controlling dozens of different types of LEDs along with optimized math, effect, and noise functions.",
      "paragraph": "Multi-platform library for controlling dozens of different types of LEDs along with optimized math, effect, and noise functions.",
      "website": "https://github.com/FastLED/FastLED",
      "category": "Display",
      "architectures": [
        "*"
      ],
      "types": [
        "Contributed"
      ]
    }
  }
]

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

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions