From 401b964e9ce212bfaafd98f7ef075ab5f9d7c805 Mon Sep 17 00:00:00 2001 From: rhysd Date: Wed, 3 Jan 2018 01:42:08 +0900 Subject: [PATCH 1/2] html: Avoid old tidy on macOS On macOS, Apple's command line toolchain installs very old `tidy` command (It was released on 31 Oct 2006). It does not consider new specs such as HTML5 so we should avoid it. --- ale_linters/html/tidy.vim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 \) From 7a1a5343054549c571425b6c48ab15ca5422337a Mon Sep 17 00:00:00 2001 From: rhysd Date: Sat, 6 Jan 2018 19:58:10 +0900 Subject: [PATCH 2/2] Explain /usr/bin/tidy is ignored on macOS and how to install the latest tidy --- doc/ale-html.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/ale-html.txt b/doc/ale-html.txt index 14e705e0..c5d5afa5 100644 --- a/doc/ale-html.txt +++ b/doc/ale-html.txt @@ -32,6 +32,21 @@ g:ale_html_htmlhint_use_global *g:ale_html_htmlhint_use_global* =============================================================================== tidy *ale-html-tidy* +`tidy` is a console application which corrects and cleans up HTML and XML +documents by fixing markup errors and upgrading legacy code to modern +standards. + +Note: +`/usr/bin/tidy` on macOS (installed by default) is too old. It was released +on 31 Oct 2006. It does not consider modern HTML specs (HTML5) and shows +outdated warnings. So |ale| ignores `/usr/bin/tidy` on macOS. + +To use `tidy` on macOS, please install the latest version with Homebrew: +> + $ brew install tidy-html5 +< +`/usr/local/bin/tidy` is installed. + g:ale_html_tidy_executable *g:ale_html_tidy_executable* *b:ale_html_tidy_executable* Type: |String|