Won't lint ST3 file marked as HTML5
Closed this issue · 9 comments
I've been struggling for 4 hours trying to get files marked as HTML5 to lint. Checking everything, looks normal. Scratching my head.
Console dump (lint errors at very bottom):
startup, version: 3059 osx x64 channel: stable
executable: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text
working dir: /
packages path: /Users/jeremy.graston/Library/Application Support/Sublime Text 3/Packages
state path: /Users/jeremy.graston/Library/Application Support/Sublime Text 3/Local
hardware concurrency: 8
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: /Users/jeremy.graston/Library/Application Support/Sublime Text 3/Installed Packages
found 5 files for base name Default.sublime-keymap
found 1 files for base name Default.sublime-mousemap
found 4 files for base name Main.sublime-menu
loading bindings
loading pointer bindings
found 1 files for base name Ayin.sublime-theme
theme loaded
app ready
wrote startup cache, added files: 1 orphaned files: 0 total files: 196 cache hits: 195
pre session restore time: 0.188416
using gpu buffer for window
using gamma: 2 (err: 6.9282)
first paint time: 0.24902
startup time: 0.273991
launching: /Applications/Sublime Text.app/Contents/MacOS/plugin_host
reloading plugin Default.block
reloading plugin Default.comment
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_file_settings
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin AngularJS.AngularJS-sublime-package
reloading plugin Package Control.Package Control
reloading plugin SublimeLinter.commands
reloading plugin SublimeLinter.sublimelinter
reloading plugin SublimeLinter-html-tidy.linter
SublimeLinter: htmltidy linter loaded
reloading plugin SublimeLinter-jshint.linter
SublimeLinter: jshint linter loaded
plugins loaded
SublimeLinter: debug mode: on
SublimeLinter: user shell: /bin/bash
SublimeLinter: computed PATH using /bin/bash:
/opt/local/bin
/opt/local/sbin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
SublimeLinter: htmltidy activated: /usr/bin/tidy
SublimeLinter: jshint activated: /usr/local/bin/jshint (disabled in settings)
loaded 1477 snippets
found 4 files for base name Main.sublime-menu
SublimeLinter: htmltidy: typography.html ['/usr/bin/tidy', '-errors', '-quiet', '-utf8']
SublimeLinter: htmltidy output:
line 11 column 9 - Error:
line 11 column 9 - Warning: discarding unexpected
line 13 column 9 - Warning: discarding unexpected
line 15 column 9 - Error:
line 15 column 9 - Warning: discarding unexpected
line 17 column 9 - Warning: discarding unexpected
/usr/bin/tidy is the system tidy, which isn't html5-aware. As mentioned in the README, you have to use the html5-aware fork of tidy for html5. Tried it here and it works fine.
If you did install the html5 tidy, the problem is that it is in /usr/local/bin and that path comes after /usr/bin. So you have to fix .bash_profile so that /usr/local/bin is at the front of PATH, before /usr/bin.
I did install the html5 tidy. I bet your last comment is the problem. Thanks for both responses. Hopefully that's the trick.
Please see the latest version of the troubleshooting docs, it includes special considerations for .bash_profile
on Mac OS X. Once you fix the path, please close this issue.
I just copied the html5 fork that was in usr/local/bin over to usr/bin. Its working now. Thanks!
I have the same problem. My PATH is correct, however the order in which the linter appears to load the paths does not match the order I have specified in my shell.
SublimeLinter: user shell: /usr/local/bin/zsh
SublimeLinter: computed PATH using /usr/local/bin/zsh:
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/opt/X11/bin
also
SublimeLinter: htmltidy activated: /usr/bin/tidy
My PATH in my shell:
% echo $PATH
/usr/local/opt/rbenv/shims:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
% which tidy
/usr/local/bin/tidy
Even though /usr/local/bin/ is specified first in my PATH, it doesn't appears as if ST (or the linter) is loading it in this order. Is there a way to manually specify the tidy executable path?
@mynameistechno Check the Troubleshooting guide at http://www.sublimelinter.com. echo $PATH
won't tell you what SublimeLinter is seeing.
Yeah I know, I put linter in debug mode to see more console output, and that's when I realized that what it computed didn't match the exported path in my .zshrc file.
The trick was to create a .zshenv file, and export the path there. I missed this in the troubleshooting section the first 5 times I went through it :P
Thanks!
This may help to someone with this issue: http://techblog.willshouse.com/2013/10/21/homebrew-tidy-html5/