Skip to content

Commit

Permalink
#1587 - Add deprecation warnings for old linter options
Browse files Browse the repository at this point in the history
  • Loading branch information
w0rp committed May 28, 2018
1 parent c0a279f commit 191967c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ale_linters/html/tidy.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@

" CLI options
let g:ale_html_tidy_executable = get(g:, 'ale_html_tidy_executable', 'tidy')
" remove in 2.0
" Look for the old _args variable first.
let s:deprecation_warning_echoed = 0
let s:default_options = get(g:, 'ale_html_tidy_args', '-q -e -language en')
let g:ale_html_tidy_options = get(g:, 'ale_html_tidy_options', s:default_options)

function! ale_linters#html#tidy#GetCommand(buffer) abort
" remove in 2.0
if exists('g:ale_html_tidy_args') && !s:deprecation_warning_echoed
execute 'echom ''Rename your g:ale_html_tidy_args setting to g:ale_html_tidy_options instead. Support for this will removed in ALE 2.0.'''
let s:deprecation_warning_echoed = 1
endif

" Specify file encoding in options
" (Idea taken from https://github.com/scrooloose/syntastic/blob/master/syntax_checkers/html/tidy.vim)
let l:file_encoding = get({
Expand Down
8 changes: 8 additions & 0 deletions ale_linters/python/flake8.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
" Author: w0rp <[email protected]>
" Description: flake8 for python files

" remove in 2.0
" Support an old setting as a fallback.
let s:deprecation_warning_echoed = 0
let s:default_options = get(g:, 'ale_python_flake8_args', '')

call ale#Set('python_flake8_executable', 'flake8')
Expand Down Expand Up @@ -38,6 +40,12 @@ function! ale_linters#python#flake8#VersionCheck(buffer) abort
endfunction

function! ale_linters#python#flake8#GetCommand(buffer, version_output) abort
" remove in 2.0
if exists('g:ale_python_flake8_args') && !s:deprecation_warning_echoed
execute 'echom ''Rename your g:ale_python_flake8_args setting to g:ale_python_flake8_options instead. Support for this will removed in ALE 2.0.'''
let s:deprecation_warning_echoed = 1
endif

let l:cd_string = ale#Var(a:buffer, 'python_flake8_change_directory')
\ ? ale#path#BufferCdString(a:buffer)
\ : ''
Expand Down

0 comments on commit 191967c

Please sign in to comment.