-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove deprecated code for the 2.0 release
- Loading branch information
Showing
6 changed files
with
2 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
" Author: KabbAmine <[email protected]> | ||
" Description: This file adds support for checking HTML code with tidy. | ||
|
||
" 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) | ||
let g:ale_html_tidy_options = get(g:, 'ale_html_tidy_options', '-q -e -language en') | ||
|
||
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({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
" 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') | ||
call ale#Set('python_flake8_options', s:default_options) | ||
call ale#Set('python_flake8_options', '') | ||
call ale#Set('python_flake8_use_global', get(g:, 'ale_use_global_executables', 0)) | ||
call ale#Set('python_flake8_change_directory', 1) | ||
|
||
|
@@ -40,12 +35,6 @@ 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) | ||
\ : '' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,6 @@ | ||
" Author: KabbAmine <[email protected]> | ||
" Description: Statusline related function(s) | ||
|
||
" remove in 2.0 | ||
" | ||
" A deprecated setting for ale#statusline#Status() | ||
" See :help ale#statusline#Count() for getting status reports. | ||
let g:ale_statusline_format = get(g:, 'ale_statusline_format', | ||
\ ['%d error(s)', '%d warning(s)', 'OK'] | ||
\) | ||
|
||
function! s:CreateCountDict() abort | ||
" Keys 0 and 1 are for backwards compatibility. | ||
" The count object used to be a List of [error_count, warning_count]. | ||
|
@@ -76,47 +68,3 @@ function! ale#statusline#Count(buffer) abort | |
" The Dictionary is copied here before exposing it to other plugins. | ||
return copy(s:GetCounts(a:buffer)) | ||
endfunction | ||
|
||
" This is the historical format setting which could be configured before. | ||
function! s:StatusForListFormat() abort | ||
let [l:error_format, l:warning_format, l:no_errors] = g:ale_statusline_format | ||
let l:counts = s:GetCounts(bufnr('')) | ||
|
||
" Build strings based on user formatting preferences. | ||
let l:errors = l:counts[0] ? printf(l:error_format, l:counts[0]) : '' | ||
let l:warnings = l:counts[1] ? printf(l:warning_format, l:counts[1]) : '' | ||
|
||
" Different formats based on the combination of errors and warnings. | ||
if empty(l:errors) && empty(l:warnings) | ||
let l:res = l:no_errors | ||
elseif !empty(l:errors) && !empty(l:warnings) | ||
let l:res = printf('%s %s', l:errors, l:warnings) | ||
else | ||
let l:res = empty(l:errors) ? l:warnings : l:errors | ||
endif | ||
|
||
return l:res | ||
endfunction | ||
|
||
" remove in 2.0 | ||
" | ||
" Returns a formatted string that can be integrated in the statusline. | ||
" | ||
" This function is deprecated, and should not be used. Use the airline plugin | ||
" instead, or write your own status function with ale#statusline#Count() | ||
function! ale#statusline#Status() abort | ||
if !get(g:, 'ale_deprecation_ale_statusline_status', 0) | ||
execute 'echom ''ale#statusline#Status() is deprecated, use ale#statusline#Count() to write your own function.''' | ||
let g:ale_deprecation_ale_statusline_status = 1 | ||
endif | ||
|
||
if !exists('g:ale_statusline_format') | ||
return 'OK' | ||
endif | ||
|
||
if type(g:ale_statusline_format) == type([]) | ||
return s:StatusForListFormat() | ||
endif | ||
|
||
return '' | ||
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters