Skip to content

Commit 363eff4

Browse files
committed
add example codes for EVL101, 102, 103
1 parent 81bc336 commit 363eff4

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

doc/vimlint.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,54 @@ EVLxxx and Exxx: error message by |vim-vimlint|.
9292

9393
variable
9494
EVL101: undefined variable `v` *EVL101*
95+
>
96+
function! Incorrect()
97+
echo v
98+
endif
99+
function! Correct1()
100+
let v = 1
101+
echo v
102+
endif
103+
" @vimlint(EVL101, 1, l:v)
104+
function! Correct2()
105+
let v = 1
106+
echo v
107+
endif
108+
" @vimlint(EVL101, 0, l:v)
109+
<
95110
EVL102: unused variable `v` *EVL102*
111+
>
112+
function! Incorrect()
113+
let a = 1
114+
let b = 2
115+
echo b
116+
endif
117+
function! Correct1()
118+
let b = 2
119+
echo b
120+
endif
121+
" @vimlint(EVL102, 1, l:a)
122+
function! Correct2(v)
123+
let a = 1
124+
let b = 2
125+
echo b
126+
endif
127+
" @vimlint(EVL103, 0, l:a)
128+
<
96129
EVL103: unused argument `v` *EVL103*
130+
>
131+
function! Incorrect(v)
132+
return 0
133+
endif
134+
function! Correct1()
135+
return 0
136+
endif
137+
" @vimlint(EVL103, 1, a:v)
138+
function! Correct2(v)
139+
return 0
140+
endif
141+
" @vimlint(EVL103, 0, a:v)
142+
<
97143
*EVL104*
98144
EVL104: variable may not be initialized on some execution path: `v`
99145
*EVL105*

0 commit comments

Comments
 (0)