summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ale_linters/python/flake8.vim1
-rw-r--r--autoload/ale/fixers/rubocop.vim2
-rw-r--r--doc/ale-java.txt6
-rw-r--r--doc/ale-php.txt18
-rw-r--r--doc/ale.txt12
-rwxr-xr-xrun-tests21
-rw-r--r--test/command_callback/test_flake8_command_callback.vader16
-rw-r--r--test/fixers/test_rubocop_fixer_callback.vader16
8 files changed, 66 insertions, 26 deletions
diff --git a/ale_linters/python/flake8.vim b/ale_linters/python/flake8.vim
index 982a098e..8aa4c4df 100644
--- a/ale_linters/python/flake8.vim
+++ b/ale_linters/python/flake8.vim
@@ -83,6 +83,7 @@ function! ale_linters#python#flake8#GetCommand(buffer, version_output) abort
return ale#Escape(ale_linters#python#flake8#GetExecutable(a:buffer))
\ . (!empty(l:options) ? ' ' . l:options : '')
+ \ . ' --format=default'
\ . l:display_name_args . ' -'
endfunction
diff --git a/autoload/ale/fixers/rubocop.vim b/autoload/ale/fixers/rubocop.vim
index 88dc1c43..35569b19 100644
--- a/autoload/ale/fixers/rubocop.vim
+++ b/autoload/ale/fixers/rubocop.vim
@@ -4,9 +4,11 @@ function! ale#fixers#rubocop#GetCommand(buffer) abort
\ ? ' exec rubocop'
\ : ''
let l:config = ale#path#FindNearestFile(a:buffer, '.rubocop.yml')
+ let l:options = ale#Var(a:buffer, 'ruby_rubocop_options')
return ale#Escape(l:executable) . l:exec_args
\ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '')
+ \ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' --auto-correct %t'
endfunction
diff --git a/doc/ale-java.txt b/doc/ale-java.txt
index 36d606de..13decb41 100644
--- a/doc/ale-java.txt
+++ b/doc/ale-java.txt
@@ -3,10 +3,10 @@ ALE Java Integration *ale-java-options*
===============================================================================
-checkstyle ale-java-checkstyle
+checkstyle *ale-java-checkstyle*
-g:ale_java_checkstyle_options g:ale_java_checkstyle_options
- b:ale_java_checkstyle_options
+g:ale_java_checkstyle_options *g:ale_java_checkstyle_options*
+ *b:ale_java_checkstyle_options*
Type: String
Default: '-c /google_checks.xml'
diff --git a/doc/ale-php.txt b/doc/ale-php.txt
index c8874106..8865021a 100644
--- a/doc/ale-php.txt
+++ b/doc/ale-php.txt
@@ -11,25 +11,25 @@ There are no options for this linter.
===============================================================================
langserver *ale-php-langserver*
-g:php_langserver_executable *g:php_langserver_executable*
- *b:php_langserver_executable*
+g:ale_php_langserver_executable *g:ale_php_langserver_executable*
+ *b:ale_php_langserver_executable*
Type: |String|
Default: `'php-language-server.php'`
The variable can be set to configure the executable that will be used for
running the PHP language server. `vendor` directory executables will be
- preferred instead of this setting if |g:php_langserver_use_global| is `0`.
+ preferred instead of this setting if |g:ale_php_langserver_use_global| is `0`.
See: |ale-integrations-local-executables|
-g:php_langserver_use_global *g:php_langserver_use_global*
- *b:php_langserver_use_global*
+g:ale_php_langserver_use_global *g:ale_php_langserver_use_global*
+ *b:ale_php_langserver_use_global*
Type: |Number|
Default: `0`
This variable can be set to `1` to force the language server to be run with
- the executable set for |g:php_langserver_executable|.
+ the executable set for |g:ale_php_langserver_executable|.
See: |ale-integrations-local-executables|
@@ -63,7 +63,7 @@ g:ale_php_phpcs_use_global *g:ale_php_phpcs_use_global*
See |ale-integrations-local-executables|
-------------------------------------------------------------------------------
+-------------------------------------------------------------------------------
phpmd *ale-php-phpmd*
g:ale_php_phpmd_ruleset *g:ale_php_phpmd_ruleset*
@@ -75,8 +75,8 @@ g:ale_php_phpmd_ruleset *g:ale_php_phpmd_ruleset*
the available phpmd rulesets
-------------------------------------------------------------------------------
-phpstan *ale-php-stan*
+-------------------------------------------------------------------------------
+phpstan *ale-php-phpstan*
g:ale_php_phpstan_executable *g:ale_php_phpstan_executable*
*b:ale_php_phpstan_executable*
diff --git a/doc/ale.txt b/doc/ale.txt
index f5a51359..869a5576 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -204,7 +204,7 @@ The following languages and tools are supported.
* nroff: 'proselint'
* Objective-C: 'clang'
* Objective-C++: 'clang'
-* OCaml: 'merlin' (see |ale-linter-integration-ocaml-merlin|)
+* OCaml: 'merlin' (see |ale-ocaml-merlin|)
* Perl: 'perl' (-c flag), 'perlcritic'
* PHP: 'hack', 'langserver', 'php' (-l flag), 'phpcs', 'phpmd', 'phpstan'
* Pod: 'proselint'
@@ -287,8 +287,8 @@ g:ale_echo_msg_error_str *g:ale_echo_msg_error_str*
Default: `Error`
The string used for error severity in the echoed message.
- Note |`g:ale_echo_cursor`| should be set to 1
- Note |`g:ale_echo_msg_format`| should contain the `%severity%` handler
+ Note |g:ale_echo_cursor| should be set to 1
+ Note |g:ale_echo_msg_format| should contain the `%severity%` handler
g:ale_echo_msg_format *g:ale_echo_msg_format*
@@ -300,7 +300,7 @@ g:ale_echo_msg_format *g:ale_echo_msg_format*
error message itself, and it can contain the following handlers:
- `%linter%` for linter's name
- `%severity%` for the type of severity
- Note |`g:ale_echo_cursor`| should be setted to 1
+ Note |g:ale_echo_cursor| should be setted to 1
g:ale_echo_msg_warning_str *g:ale_echo_msg_warning_str*
@@ -309,8 +309,8 @@ g:ale_echo_msg_warning_str *g:ale_echo_msg_warning_str*
Default: `Warning`
The string used for warning severity in the echoed message.
- Note |`g:ale_echo_cursor`| should be set to 1
- Note |`g:ale_echo_msg_format`| should contain the `%severity%` handler
+ Note |g:ale_echo_cursor| should be set to 1
+ Note |g:ale_echo_msg_format| should contain the `%severity%` handler
g:ale_emit_conflict_warnings *g:ale_emit_conflict_warnings*
diff --git a/run-tests b/run-tests
index b32ac703..eb398d0d 100755
--- a/run-tests
+++ b/run-tests
@@ -55,6 +55,12 @@ while [ $# -ne 0 ]; do
run_custom_checks=0
shift
;;
+ --custom-checks-only)
+ run_vim_tests=0
+ run_neovim_tests=0
+ run_vint=0
+ shift
+ ;;
--)
shift
break
@@ -211,6 +217,21 @@ if ((run_custom_checks)); then
echo
grep --exclude=tags -roh '\*.*\*$' doc | sort | uniq -d || EXIT=$?
+
+ echo '========================================'
+ echo 'Checking for invalid tag references'
+ echo '========================================'
+ echo 'Invalid tag references tags follow:'
+ echo
+
+ tag_regex='[gb]\?:\?\(ale\|ALE\)[a-zA-Z_\-]\+'
+
+ # Grep for tags and references, and complain if we find a reference without
+ # a tag for the reference. Only our tags will be included.
+ diff -u \
+ <(grep --exclude=tags -roh "\*$tag_regex\*" doc | sort -u | sed 's/*//g') \
+ <(grep --exclude=tags -roh "|$tag_regex|" doc | sort -u | sed 's/|//g') \
+ | grep '^+[^+]' && EXIT=1
fi
exit $EXIT
diff --git a/test/command_callback/test_flake8_command_callback.vader b/test/command_callback/test_flake8_command_callback.vader
index 70527ad3..c36fe4f5 100644
--- a/test/command_callback/test_flake8_command_callback.vader
+++ b/test/command_callback/test_flake8_command_callback.vader
@@ -19,23 +19,23 @@ Execute(The flake8 callbacks should return the correct default values):
\ '''flake8'' --version',
\ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual
- \ '''flake8'' --stdin-display-name %s -',
+ \ '''flake8'' --format=default --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
" Try with older versions.
call ale_linters#python#flake8#ClearVersionCache()
AssertEqual
- \ '''flake8'' -',
+ \ '''flake8'' --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
Execute(The flake8 command callback should let you set options):
let g:ale_python_flake8_options = '--some-option'
AssertEqual
- \ '''flake8'' --some-option --stdin-display-name %s -',
+ \ '''flake8'' --some-option --format=default --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.4'])
call ale_linters#python#flake8#ClearVersionCache()
AssertEqual
- \ '''flake8'' --some-option -',
+ \ '''flake8'' --some-option --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
Execute(You should be able to set a custom executable and it should be escaped):
@@ -48,7 +48,7 @@ Execute(You should be able to set a custom executable and it should be escaped):
\ '''executable with spaces'' --version',
\ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual
- \ '''executable with spaces'' --stdin-display-name %s -',
+ \ '''executable with spaces'' --format=default --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
Execute(The flake8 callbacks should detect virtualenv directories):
@@ -62,7 +62,7 @@ Execute(The flake8 callbacks should detect virtualenv directories):
\ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual
\ '''' . g:dir . '/python_paths/with_virtualenv/env/bin/flake8'''
- \ . ' --stdin-display-name %s -',
+ \ . ' --format=default --stdin-display-name %s -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['3.0.0'])
Execute(The FindProjectRoot should detect the project root directory for namespace package via Manifest.in):
@@ -114,7 +114,7 @@ Execute(Using `python -m flake8` should be supported for running flake8):
\ '''python'' -m flake8 --version',
\ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual
- \ '''python'' -m flake8 --some-option -',
+ \ '''python'' -m flake8 --some-option --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
call ale_linters#python#flake8#ClearVersionCache()
@@ -129,5 +129,5 @@ Execute(Using `python -m flake8` should be supported for running flake8):
\ '''python'' -m flake8 --version',
\ ale_linters#python#flake8#VersionCheck(bufnr(''))
AssertEqual
- \ '''python'' -m flake8 --some-option -',
+ \ '''python'' -m flake8 --some-option --format=default -',
\ ale_linters#python#flake8#GetCommand(bufnr(''), ['2.9.9'])
diff --git a/test/fixers/test_rubocop_fixer_callback.vader b/test/fixers/test_rubocop_fixer_callback.vader
index e3383537..87d56d07 100644
--- a/test/fixers/test_rubocop_fixer_callback.vader
+++ b/test/fixers/test_rubocop_fixer_callback.vader
@@ -1,8 +1,10 @@
Before:
Save g:ale_ruby_rubocop_executable
+ Save g:ale_ruby_rubocop_options
" Use an invalid global executable, so we don't match it.
let g:ale_ruby_rubocop_executable = 'xxxinvalid'
+ let g:ale_ruby_rubocop_options = ''
call ale#test#SetDirectory('/testplugin/test/fixers')
silent cd ..
@@ -36,3 +38,17 @@ Execute(The rubocop callback should include configuration files):
\ . ' --auto-correct %t',
\ },
\ ale#fixers#rubocop#Fix(bufnr(''))
+
+Execute(The rubocop callback should include custom rubocop options):
+ let g:ale_ruby_rubocop_options = '--except Lint/Debugger'
+ call ale#test#SetFilename('ruby_paths/with_config/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
+ \ . ' --config ' . ale#Escape(g:dir . '/ruby_paths/with_config/.rubocop.yml')
+ \ . ' --except Lint/Debugger'
+ \ . ' --auto-correct %t',
+ \ },
+ \ ale#fixers#rubocop#Fix(bufnr(''))