Skip to content
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

[FEATURE REQUEST] Add some more fields in the message #708

Closed
sbrunner opened this issue Dec 27, 2024 · 0 comments
Closed

[FEATURE REQUEST] Add some more fields in the message #708

sbrunner opened this issue Dec 27, 2024 · 0 comments
Assignees

Comments

@sbrunner
Copy link
Member

sbrunner commented Dec 27, 2024

I started the support of Prospector in vscode-linter
fnando/vscode-linter#47

And I see that we have some missing information in the message:
line_end, character_end, doc_url and is_fixable.

Think that we should add this information to the Message (Location) object, use the in the JSON output.

We probably also need to add a --no-fix command line options.

Example of Pylint output:

   {
       "type": "convention",
       "module": "test",
       "obj": "aaBbb",
       "line": 22,
       "column": 0,
       "endLine": 22,
       "endColumn": 9,
       "path": "test.py",
       "symbol": "invalid-name",
       "message": "Function name \"aaBbb\" doesn't conform to snake_case naming style",
       "message-id": "C0103"
   }

Doc URL: https://pylint.pycqa.org/en/latest/user_guide/messages/convention/invalid-name.html
=> https://pylint.pycqa.org/en/latest/user_guide/messages/{type}/{symbol}.html

and Ruff:

 {
   "cell": null,
   "code": "E743",
   "end_location": {
     "column": 6,
     "row": 4
   },
   "filename": "/home/sbrunner/workspace/prospector/test.py",
   "fix": null,
   "location": {
     "column": 5,
     "row": 4
   },
   "message": "Ambiguous function name: `l`",
   "noqa_row": 4,
   "url": "https://docs.astral.sh/ruff/rules/ambiguous-function-name"
 }

Bandit:

    {
      "code": "28 # hhh\n29 subprocess.run(['ls'])\n",
      "col_offset": 0,
      "end_col_offset": 22,
      "filename": "./test.py",
      "issue_confidence": "HIGH",
      "issue_cwe": {
        "id": 78,
        "link": "https://cwe.mitre.org/data/definitions/78.html"
      },
      "issue_severity": "LOW",
      "issue_text": "subprocess call - check for execution of untrusted input.",
      "line_number": 29,
      "line_range": [
        29
      ],
      "more_info": "https://bandit.readthedocs.io/en/1.7.10/plugins/b603_subprocess_without_shell_equals_true.html",
      "test_id": "B603",
      "test_name": "subprocess_without_shell_equals_true"
    }
@sbrunner sbrunner changed the title [FEATURE REQUEST] [FEATURE REQUEST] add some more fields in the message Dec 27, 2024
@sbrunner sbrunner changed the title [FEATURE REQUEST] add some more fields in the message [FEATURE REQUEST] Add some more fields in the message Dec 27, 2024
@sbrunner sbrunner self-assigned this Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant