summaryrefslogtreecommitdiff
path: root/ale_linters/html
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/html')
-rw-r--r--ale_linters/html/alex.vim11
-rw-r--r--ale_linters/html/tidy.vim10
2 files changed, 20 insertions, 1 deletions
diff --git a/ale_linters/html/alex.vim b/ale_linters/html/alex.vim
new file mode 100644
index 00000000..5a1f61e9
--- /dev/null
+++ b/ale_linters/html/alex.vim
@@ -0,0 +1,11 @@
+" Author: Johannes Wienke <languitar@semipol.de>
+" Description: alex for HTML files
+
+call ale#linter#Define('html', {
+\ 'name': 'alex',
+\ 'executable': 'alex',
+\ 'command': 'alex %s -t',
+\ 'output_stream': 'stderr',
+\ 'callback': 'ale#handlers#alex#Handle',
+\ 'lint_file': 1,
+\})
diff --git a/ale_linters/html/tidy.vim b/ale_linters/html/tidy.vim
index 4a55d62f..34152c6b 100644
--- a/ale_linters/html/tidy.vim
+++ b/ale_linters/html/tidy.vim
@@ -25,8 +25,16 @@ function! ale_linters#html#tidy#GetCommand(buffer) abort
\ 'utf-8': '-utf8',
\ }, &fileencoding, '-utf8')
+ " On macOS, old tidy (released on 31 Oct 2006) is installed. It does not
+ " consider HTML5 so we should avoid it.
+ let l:executable = ale#Var(a:buffer, 'html_tidy_executable')
+ if has('mac') && l:executable is# 'tidy' && exists('*exepath')
+ \ && exepath(l:executable) is# '/usr/bin/tidy'
+ return ''
+ endif
+
return printf('%s %s %s -',
- \ ale#Var(a:buffer, 'html_tidy_executable'),
+ \ l:executable,
\ ale#Var(a:buffer, 'html_tidy_options'),
\ l:file_encoding
\)