codeclimate/codeclimate-swiftlint

Invalid JSON error

larkinscott opened this issue · 1 comments

I ran across a few invalid JSON errors while testing on multiple repos:

https://github.com/ReactiveX/RxSwift

    D, [2018-03-01T19:56:53.765117 #1] DEBUG -- : engine stdout:

    {
    "categories": [
      "Style"
    ],
    "check_name": "Colon",
    "description": "Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.",
    "location": {
      "lines": {
        "begin": 42,
        "end": 42
      },
      "path": "RxExamp

    W, [2018-03-01T19:56:53.765358 #1]  WARN -- : killing container name=cc-engines-swiftlint-stable-a113a152-994b-4d49-8988-a78b9dcf5282 message="output invalid"

    I, [2018-03-01T19:56:53.845569 #1]  INFO -- : finished engine swiftlint
    error: (CC::CLI::Analyze::EngineFailure) engine swiftlint failed with status 99 and stderr
    engine produced invalid output: {:message=>"Invalid JSON", :output=>"\n{\n  \"categories\": [\n    \"Style\"\n  ],\n  \"check_name\": \"Colon\",\n  \"description\": \"Col
    ons should be next to the identifier when specifying a type and next to the key in dictionary literals.\",\n  \"location\": {\n    \"lines\": {\n      \"begin\": 42,\n
     \"end\": 42\n    },\n    \"path\": \"RxExamp"}

https://github.com/GitHawkApp/MessageViewController

    error: (CC::CLI::Analyze::EngineFailure) engine swiftlint failed with status 99 and stderr

    engine produced invalid output: {:message=>"Invalid JSON", :output=>"\n{\n  \"categories\": [\n    \"Style\"\n  ],\n  \"check_name\": \"Redundant Discardable Let\",\n  \"description\": \"Prefer `_
    = foo()` over `let _ = foo()` when discarding a result from"}

    Note: SwiftLint handles it like:
      /Users/scottlarkin/code/swiftlint-test/MessageViewController/MessageViewController/MessageViewController.swift:223:13: warning: Redundant Discardable Let Violation: Prefer `_ = foo()` over `let _ = foo()` when discarding a result from a function. (redundant_discardable_let)

I confirmed that this was fixed by fixing #1 and #2. Closing this out.