Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Fix #76: discard non-issue messages #84

Closed
wants to merge 1 commit into from

Conversation

inakiabt
Copy link

@inakiabt inakiabt commented Mar 6, 2018

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
Copy link
Author

inakiabt commented Mar 6, 2018

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

@Arcanemagus
Copy link
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants