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

Request: Support for setting path to "haml-lint" executable #1

Closed
johanlunds opened this issue Feb 6, 2015 · 7 comments
Closed

Request: Support for setting path to "haml-lint" executable #1

johanlunds opened this issue Feb 6, 2015 · 7 comments

Comments

@johanlunds
Copy link

For reference see:

@johanlunds johanlunds changed the title Support for setting path to "haml-lint" executable Request: Support for setting path to "haml-lint" executable Feb 6, 2015
@jschroeder9000
Copy link
Member

Thank you for the feedback and references. This seems like a simple request, I will try to implement this over the weekend.

@johanlunds
Copy link
Author

That's awesome!

@jschroeder9000
Copy link
Member

This feature has been implemented and released in v0.1.1. Please let me know if it does not meet your needs.

@johanlunds
Copy link
Author

FYI, update:

It doesn't give an error now (which I seem to recall it did before when it couldn't find the executable path). However no lint-results show up.

± % which haml-lint                                                                                                                                     !8234
/usr/local/var/rbenv/shims/haml-lint
± % haml-lint app/views/admin/consignment.haml                                                                                                          !8233
app/views/admin/consignment.haml:3 [W] TrailingWhitespace: Line contains trailing whitespace
app/views/admin/consignment.haml:4 [W] RuboCop: Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
app/views/admin/consignment.haml:4 [W] TrailingWhitespace: Line contains trailing whitespace
app/views/admin/consignment.haml:10 [W] RuboCop: Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
app/views/admin/consignment.haml:10 [W] RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
app/views/admin/consignment.haml:10 [W] RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

My config: https://gist.github.com/johanlunds/0720c4c67e8028296f1a#file-config-cson-L36-L37

Screenshot from Atom of the same file:

developer_tools_and_consignment_haml_-_users_johan_lunds_documents_kod_apoex2-atom_and_request__support_for_setting_path_to__haml-lint__executable issue__1 _atomlinter_linter-haml

Atom has been restarted and both plugins are active.

Versions:

  • linter-haml, 0.1.1
  • language-haml, 0.15.0
  • linter, 0.11.1
  • Ruby gem "haml-lint", 0.11.0

Any idea what it could be?

@jschroeder9000
Copy link
Member

Hmm... I admit I feel a bit stumped. Everything seems to be in order there.

When I was testing the implementation, I dropped a haml-lint file in my home directory that was a simple shell script:

#!/bin/sh

echo "sessions/new.html.haml:1 [W] SpaceBeforeScript: Testing exe path"

This way I could easily detect if it was working the way I thought it should by setting my home directory as the executable path.

If you create a ~/haml-lint file (remember to make it executable) with the contents:

#!/bin/sh

echo "app/views/admin/consignment.haml:3 [W] TrailingWhitespace: Line contains trailing whitespace
app/views/admin/consignment.haml:4 [W] RuboCop: Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
app/views/admin/consignment.haml:4 [W] TrailingWhitespace: Line contains trailing whitespace
app/views/admin/consignment.haml:10 [W] RuboCop: Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
app/views/admin/consignment.haml:10 [W] RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.                   
app/views/admin/consignment.haml:10 [W] RuboCop: Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols."

And set the executable path to your home directory, do you get the expected results?

To debug further, you can set:

linter:
  lintDebug: true

In your config.cson to make the main linter package's console output much more verbose. Then try switching back and forth to/from haml files.

@johanlunds
Copy link
Author

Just noticed: it works now! Don't know why or what changed, but perhaps I just needed to restart the editor or computer or something.

screen shot 2015-02-18 at 11 54 25

@johanlunds
Copy link
Author

Thanks for all your help!

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

No branches or pull requests

2 participants