SublimeLinter / SublimeLinter-haml-lint

SublimeLinter 3 plugin for Haml, using haml-lint.
MIT License
4 stars 8 forks source link

Does show errors/warnings in Sublime v3 #12

Open palexvs opened 4 years ago

palexvs commented 4 years ago

I have a test file test.html.haml:

%div
  - if true
    %b A
  - else

%b B

When I run haml-lint gem manually I'm getting errors that is correct:

→ bundle exec haml-lint test.html.haml
test.html.haml:2 [W] RuboCop: Lint/LiteralAsCondition: Literal `true` appeared as a condition.
test.html.haml:4 [W] RuboCop: Style/EmptyElse: Redundant `else`-clause.

1 file inspected, 2 lints detected

→ /Users/palexvs/.rbenv/shims/haml-lint test.html.haml
test.html.haml:2 [W] RuboCop: Lint/LiteralAsCondition: Literal `true` appeared as a condition.
test.html.haml:4 [W] RuboCop: Style/EmptyElse: Redundant `else`-clause.

1 file inspected, 2 lints detected

But in Sublime no line is highlighted: image

There is my current SublimeLinter.sublime-settings config:

{
  "debug": true,
  "styles": [
    {
      "mark_style": "stippled_underline",
      "priority": 1,
      "scope": "source.ruby.rails keyword.control.ruby",
      "icon": "pointer",
      "types": [
        "warning"
      ]
    }
  ],
  "linters": {
    "rubocop": {
      "use_bundle_exec": true,
      "executable": "/Users/palexvs/.rbenv/shims/rubocop",
      "selector": "source.ruby - text.haml",
    },
    "ruby": {
      "use_bundle_exec": true,
      "executable": "/Users/palexvs/.rbenv/shims/rubocop",
      "selector": "source.ruby - text.haml",
    },
    "haml_lint": {
      "use_bundle_exec": true,
      "executable": "/Users/palexvs/.rbenv/shims/haml-lint",
      "selector": "text.haml",
    }
  }
}
kaste commented 4 years ago

The debug output in the Sublime console could give you some hints. Especially which command we execute here.

That being said, the plugin code looks outdated and confusing. Would have to dig in, but it looks like executable is not even supported.

LeEnno commented 4 years ago

Setting executable will have no affects, I can confirm that.

Also how about use_bundle_exec? I can't find this option in the docs.

kaste commented 4 years ago

use_bundle_exec is not implemented here. Iirc it is implemented (only?) for rubocop. This would be solved by https://github.com/SublimeLinter/SublimeLinter/issues/1759