Skip to content

Commit db85b93

Browse files
committed
Remove deprecated code for the 2.0 release
1 parent 602e7fa commit db85b93

File tree

6 files changed

+2
-148
lines changed

6 files changed

+2
-148
lines changed

ale_linters/html/tidy.vim

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
" Author: KabbAmine <[email protected]>
22
" Description: This file adds support for checking HTML code with tidy.
33

4-
" CLI options
54
let g:ale_html_tidy_executable = get(g:, 'ale_html_tidy_executable', 'tidy')
6-
" remove in 2.0
7-
" Look for the old _args variable first.
8-
let s:deprecation_warning_echoed = 0
9-
let s:default_options = get(g:, 'ale_html_tidy_args', '-q -e -language en')
10-
let g:ale_html_tidy_options = get(g:, 'ale_html_tidy_options', s:default_options)
5+
let g:ale_html_tidy_options = get(g:, 'ale_html_tidy_options', '-q -e -language en')
116

127
function! ale_linters#html#tidy#GetCommand(buffer) abort
13-
" remove in 2.0
14-
if exists('g:ale_html_tidy_args') && !s:deprecation_warning_echoed
15-
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.'''
16-
let s:deprecation_warning_echoed = 1
17-
endif
18-
198
" Specify file encoding in options
209
" (Idea taken from https://github.com/scrooloose/syntastic/blob/master/syntax_checkers/html/tidy.vim)
2110
let l:file_encoding = get({

ale_linters/python/flake8.vim

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
" Author: w0rp <[email protected]>
22
" Description: flake8 for python files
33

4-
" remove in 2.0
5-
" Support an old setting as a fallback.
6-
let s:deprecation_warning_echoed = 0
7-
let s:default_options = get(g:, 'ale_python_flake8_args', '')
8-
94
call ale#Set('python_flake8_executable', 'flake8')
10-
call ale#Set('python_flake8_options', s:default_options)
5+
call ale#Set('python_flake8_options', '')
116
call ale#Set('python_flake8_use_global', get(g:, 'ale_use_global_executables', 0))
127
call ale#Set('python_flake8_change_directory', 1)
138

@@ -40,12 +35,6 @@ function! ale_linters#python#flake8#VersionCheck(buffer) abort
4035
endfunction
4136

4237
function! ale_linters#python#flake8#GetCommand(buffer, version_output) abort
43-
" remove in 2.0
44-
if exists('g:ale_python_flake8_args') && !s:deprecation_warning_echoed
45-
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.'''
46-
let s:deprecation_warning_echoed = 1
47-
endif
48-
4938
let l:cd_string = ale#Var(a:buffer, 'python_flake8_change_directory')
5039
\ ? ale#path#BufferCdString(a:buffer)
5140
\ : ''

autoload/ale/engine.vim

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,6 @@ function! ale#engine#SetResults(buffer, loclist) abort
270270

271271
" Call user autocommands. This allows users to hook into ALE's lint cycle.
272272
silent doautocmd <nomodeline> User ALELintPost
273-
" remove in 2.0
274-
" Old DEPRECATED name; call it for backwards compatibility.
275-
silent doautocmd <nomodeline> User ALELint
276273
endif
277274
endfunction
278275

autoload/ale/statusline.vim

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
" Author: KabbAmine <[email protected]>
22
" Description: Statusline related function(s)
33

4-
" remove in 2.0
5-
"
6-
" A deprecated setting for ale#statusline#Status()
7-
" See :help ale#statusline#Count() for getting status reports.
8-
let g:ale_statusline_format = get(g:, 'ale_statusline_format',
9-
\ ['%d error(s)', '%d warning(s)', 'OK']
10-
\)
11-
124
function! s:CreateCountDict() abort
135
" Keys 0 and 1 are for backwards compatibility.
146
" The count object used to be a List of [error_count, warning_count].
@@ -76,47 +68,3 @@ function! ale#statusline#Count(buffer) abort
7668
" The Dictionary is copied here before exposing it to other plugins.
7769
return copy(s:GetCounts(a:buffer))
7870
endfunction
79-
80-
" This is the historical format setting which could be configured before.
81-
function! s:StatusForListFormat() abort
82-
let [l:error_format, l:warning_format, l:no_errors] = g:ale_statusline_format
83-
let l:counts = s:GetCounts(bufnr(''))
84-
85-
" Build strings based on user formatting preferences.
86-
let l:errors = l:counts[0] ? printf(l:error_format, l:counts[0]) : ''
87-
let l:warnings = l:counts[1] ? printf(l:warning_format, l:counts[1]) : ''
88-
89-
" Different formats based on the combination of errors and warnings.
90-
if empty(l:errors) && empty(l:warnings)
91-
let l:res = l:no_errors
92-
elseif !empty(l:errors) && !empty(l:warnings)
93-
let l:res = printf('%s %s', l:errors, l:warnings)
94-
else
95-
let l:res = empty(l:errors) ? l:warnings : l:errors
96-
endif
97-
98-
return l:res
99-
endfunction
100-
101-
" remove in 2.0
102-
"
103-
" Returns a formatted string that can be integrated in the statusline.
104-
"
105-
" This function is deprecated, and should not be used. Use the airline plugin
106-
" instead, or write your own status function with ale#statusline#Count()
107-
function! ale#statusline#Status() abort
108-
if !get(g:, 'ale_deprecation_ale_statusline_status', 0)
109-
execute 'echom ''ale#statusline#Status() is deprecated, use ale#statusline#Count() to write your own function.'''
110-
let g:ale_deprecation_ale_statusline_status = 1
111-
endif
112-
113-
if !exists('g:ale_statusline_format')
114-
return 'OK'
115-
endif
116-
117-
if type(g:ale_statusline_format) == type([])
118-
return s:StatusForListFormat()
119-
endif
120-
121-
return ''
122-
endfunction

plugin/ale.vim

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ if !s:has_features
3232
finish
3333
endif
3434

35-
" remove in 2.0
36-
if has('nvim') && !has('nvim-0.2.0') && !get(g:, 'ale_use_deprecated_neovim')
37-
execute 'echom ''ALE support for NeoVim versions below 0.2.0 is deprecated.'''
38-
execute 'echom ''Use `let g:ale_use_deprecated_neovim = 1` to silence this warning for now.'''
39-
endif
40-
4135
" Set this flag so that other plugins can use it, like airline.
4236
let g:loaded_ale = 1
4337

@@ -231,25 +225,3 @@ augroup ALECleanupGroup
231225
autocmd BufDelete * if exists('*ale#engine#Cleanup') | call ale#engine#Cleanup(str2nr(expand('<abuf>'))) | endif
232226
autocmd QuitPre * call ale#events#QuitEvent(str2nr(expand('<abuf>')))
233227
augroup END
234-
235-
" Backwards Compatibility
236-
237-
" remove in 2.0
238-
function! ALELint(delay) abort
239-
if !get(g:, 'ale_deprecation_ale_lint', 0)
240-
execute 'echom ''ALELint() is deprecated, use ale#Queue() instead.'''
241-
let g:ale_deprecation_ale_lint = 1
242-
endif
243-
244-
call ale#Queue(a:delay)
245-
endfunction
246-
247-
" remove in 2.0
248-
function! ALEGetStatusLine() abort
249-
if !get(g:, 'ale_deprecation_ale_get_status_line', 0)
250-
execute 'echom ''ALEGetStatusLine() is deprecated.'''
251-
let g:ale_deprecation_ale_get_status_line = 1
252-
endif
253-
254-
return ale#statusline#Status()
255-
endfunction

test/test_statusline.vader

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -91,51 +91,10 @@ Execute (Count should be match the loclist):
9191
Execute (Output should be empty for non-existent buffer):
9292
AssertEqual Counts({}), ale#statusline#Count(9001)
9393

94-
Execute (Status() should return just errors for the old format):
95-
let g:ale_statusline_format = ['%sE', '%sW', 'OKIE']
96-
let g:ale_buffer_info = {bufnr(''): {}}
97-
call ale#statusline#Update(bufnr(''), [
98-
\ {'bufnr': bufnr(''), 'type': 'E'},
99-
\ {'bufnr': bufnr(''), 'type': 'E', 'sub_type': 'style'},
100-
\])
101-
AssertEqual '2E', ale#statusline#Status()
102-
103-
Execute (Status() should return just warnings for the old format):
104-
let g:ale_statusline_format = ['%sE', '%sW', 'OKIE']
105-
let g:ale_buffer_info = {bufnr(''): {}}
106-
call ale#statusline#Update(bufnr(''), [
107-
\ {'bufnr': bufnr(''), 'type': 'W'},
108-
\ {'bufnr': bufnr(''), 'type': 'W', 'sub_type': 'style'},
109-
\ {'bufnr': bufnr(''), 'type': 'I'},
110-
\])
111-
AssertEqual '3W', ale#statusline#Status()
112-
113-
Execute (Status() should return errors and warnings for the old format):
114-
let g:ale_statusline_format = ['%sE', '%sW', 'OKIE']
115-
let g:ale_buffer_info = {bufnr(''): {}}
116-
call ale#statusline#Update(bufnr(''), [
117-
\ {'bufnr': bufnr(''), 'type': 'E'},
118-
\ {'bufnr': bufnr(''), 'type': 'E', 'sub_type': 'style'},
119-
\ {'bufnr': bufnr(''), 'type': 'W'},
120-
\ {'bufnr': bufnr(''), 'type': 'W', 'sub_type': 'style'},
121-
\ {'bufnr': bufnr(''), 'type': 'I'},
122-
\])
123-
AssertEqual '2E 3W', ale#statusline#Status()
124-
125-
Execute (Status() should return the custom 'OK' string with the old format):
126-
let g:ale_statusline_format = ['%sE', '%sW', 'OKIE']
127-
let g:ale_buffer_info = {bufnr(''): {}}
128-
call ale#statusline#Update(bufnr(''), [])
129-
AssertEqual 'OKIE', ale#statusline#Status()
130-
13194
Execute(ale#statusline#Update shouldn't blow up when globals are undefined):
13295
unlet! g:ale_statusline_format
13396
call ale#statusline#Update(1, [])
13497

13598
Execute(ale#statusline#Count should return 0 counts when globals are undefined):
13699
unlet! g:ale_statusline_format
137100
AssertEqual Counts({}), ale#statusline#Count(1)
138-
139-
Execute(ale#statusline#Status should return 'OK' when globals are undefined):
140-
unlet! g:ale_statusline_format
141-
AssertEqual 'OK', ale#statusline#Status()

0 commit comments

Comments
 (0)