AtomLinter / linter-codeclimate

An Atom Linter plugin for the Code Climate CLI
http://github.com/codeclimate/codeclimate
MIT License
10 stars 5 forks source link

Fix #76: discard non-issue messages #84

Closed inakiabt closed 6 years ago

inakiabt commented 6 years ago

I followed @a-ali suggestion in #76 but checking type's lowercase to equal "issue" because there are cases where type: "issue" and others type: "Issue":

[
  {
    "categories": [
      "Complexity"
    ],
    "check_name": "method_lines",
    "content": {
      "body": ""
    },
    "description": "Method `long_one` has 42 lines of code (exceeds 25 allowed). Consider refactoring.",
    "fingerprint": "caa1f07ae4f68cf288328348e01a0d63",
    "location": {
      "path": "cool_code.rb",
      "lines": {
        "begin": 7,
        "end": 50
      }
    },
    "other_locations": [],
    "remediation_points": 1008000,
    "severity": "minor",
    "type": "issue", //<---------this
    "engine_name": "structure"
  },
  {
    "name": "ruby.parse.succeeded",
    "type": "measurement",
    "value": 1,
    "engine_name": "structure"
  },
  {
    "type": "Issue", //<---------this
    "check_name": "Rubocop/Layout/SpaceAfterMethodName",
    "description": "Do not put a space between a method name and the opening parenthesis.",
    "categories": [
      "Style"
    ],
    "remediation_points": 50000,
    "location": {
      "path": "cool_code.rb",
      "positions": {
        "begin": {
          "column": 10,
          "line": 2
        },
        "end": {
          "column": 11,
          "line": 2
        }
      }
    },
    "content": {
      "body": "Checks for space between a method name and a left parenthesis in defs.\n\n### Example:\n\n    # bad\n    def func (x) end\n    def method= (y) end\n\n    # good\n    def func(x) end\n    def method=(y) end"
    },
    "engine_name": "rubocop",
    "fingerprint": "7ff4a8c6c8db642eb1022838a02510d3",
    "severity": "minor"
  },

Also, I've to change the tests because as you can see the order of the messages is different than the expected (I think more of them are returned by codeclimate): rubocop's one is not the first one anymore.

I'm using codeclimate cli version 0.71.1.

inakiabt commented 6 years ago

I've totally missed #77 was opened. Let me know if you prefer to close this one.

Arcanemagus commented 6 years ago

Looks like this was also closed by #83, thanks for your contribution @inakiabt!