Skip to content

Commit 94722c5

Browse files
committed
patch 9.0.1257: code style is not check in test scripts
Problem: Code style is not check in test scripts. Solution: Add basic code style check for test files.
1 parent 04e4f1d commit 94722c5

56 files changed

Lines changed: 247 additions & 208 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/testdir/keycode_check.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ vim9script
44
#
55
# Usage: vim -u NONE -S keycode_check.vim
66
#
7-
# Author: Bram Moolenaar
8-
# Last Update: 2022 Nov 15
7+
# Author: Bram Moolenaar
8+
# Last Update: 2022 Nov 15
99
#
1010
# The codes are stored in the file "keycode_check.json", so that you can
1111
# compare the results of various terminals.
@@ -449,7 +449,7 @@ enddef
449449
# The main loop
450450
while true
451451
var action = inputlist(['Select operation:',
452-
'1. List results',
452+
'1. List results',
453453
'2. Add results for a new terminal',
454454
'3. Replace results',
455455
'4. Clear results',

src/testdir/runtest.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if has('gui_running')
5959
endif
6060

6161
" Check that the screen size is at least 24 x 80 characters.
62-
if &lines < 24 || &columns < 80
62+
if &lines < 24 || &columns < 80
6363
let error = 'Screen size too small! Tests require at least 24 lines with 80 characters, got ' .. &lines .. ' lines with ' .. &columns .. ' characters'
6464
echoerr error
6565
split test.log

src/testdir/setup.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if has('packages')
2020
let &packpath = &rtp
2121
endif
2222

23-
" Only when the +eval feature is present.
23+
" Only when the +eval feature is present.
2424
if 1
2525
" Make sure the .Xauthority file can be found after changing $HOME.
2626
if $XAUTHORITY == ''

src/testdir/summarize.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if 1
3333
silent %s/^SKIPPED \zs.*/\=Count(submatch(0), 'skipped')/egn
3434
silent %s/^\(\d\+\)\s\+FAILED:/\=Count(submatch(1), 'failed')/egn
3535

36-
call extend(output, ["Skipped:"])
36+
call extend(output, ["Skipped:"])
3737
call extend(output, skipped_output)
3838

3939
call extend(output, [

src/testdir/test_assert.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ func Test_wrong_error_type()
190190
endfunc
191191

192192
func Test_compare_fail()
193-
let s:v = {}
194-
let s:x = {"a": s:v}
195-
let s:v["b"] = s:x
193+
let s:v = {}
194+
let s:x = {"a": s:v}
195+
let s:v["b"] = s:x
196196
let s:w = {"c": s:x, "d": ''}
197197
try
198198
call assert_equal(s:w, '')

src/testdir/test_autocmd.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ func Test_win_tab_autocmd()
269269
augroup testing
270270
au WinNew * call add(g:record, 'WinNew')
271271
au WinClosed * call add(g:record, 'WinClosed')
272-
au WinEnter * call add(g:record, 'WinEnter')
273-
au WinLeave * call add(g:record, 'WinLeave')
272+
au WinEnter * call add(g:record, 'WinEnter')
273+
au WinLeave * call add(g:record, 'WinLeave')
274274
au TabNew * call add(g:record, 'TabNew')
275275
au TabClosed * call add(g:record, 'TabClosed')
276276
au TabEnter * call add(g:record, 'TabEnter')
@@ -3406,7 +3406,7 @@ endfunc
34063406

34073407
func Test_Visual_doautoall_redraw()
34083408
call setline(1, ['a', 'b'])
3409-
new
3409+
new
34103410
wincmd p
34113411
call feedkeys("G\<C-V>", 'txn')
34123412
autocmd User Explode ++once redraw
@@ -4121,7 +4121,7 @@ endfunc
41214121

41224122
func Test_autocmd_split_dummy()
41234123
" Autocommand trying to split a window containing a dummy buffer.
4124-
auto BufReadPre * exe "sbuf " .. expand("<abuf>")
4124+
auto BufReadPre * exe "sbuf " .. expand("<abuf>")
41254125
" Avoid the "W11" prompt
41264126
au FileChangedShell * let v:fcs_choice = 'reload'
41274127
func Xautocmd_changelist()

src/testdir/test_blob.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ func Test_blob_read_write()
498498
call assert_equal(b[-3 :], br5)
499499
VAR br6 = readblob('Xblob', -3, 2)
500500
call assert_equal(b[-3 : -2], br6)
501-
501+
502502
#" reading past end of file, empty result
503503
VAR br1e = readblob('Xblob', 10000)
504504
call assert_equal(0z, br1e)

src/testdir/test_blockedit.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func Test_blockinsert_autoindent()
5252
let expected =<< trim END
5353
vim9script
5454
var d = {
55-
a: (): asdf => 0,
55+
a: (): asdf => 0,
5656
b: (): asdf => 0,
5757
c: (): asdf => 0,
5858
}

src/testdir/test_channel.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ endif
2020
" call ch_logfile('channellog', 'w')
2121

2222
func SetUp()
23-
if g:testfunc =~ '_ipv6()$'
23+
if g:testfunc =~ '_ipv6()$'
2424
let s:localhost = '[::1]:'
2525
let s:testscript = 'test_channel_6.py'
2626
elseif g:testfunc =~ '_unix()$'
@@ -1220,7 +1220,7 @@ endfunc
12201220
func Test_pipe_to_buffer_raw()
12211221
let options = {'out_mode': 'raw', 'out_io': 'buffer', 'out_name': 'testout'}
12221222
split testout
1223-
let job = job_start([s:python, '-c',
1223+
let job = job_start([s:python, '-c',
12241224
\ 'import sys; [sys.stdout.write(".") and sys.stdout.flush() for _ in range(10000)]'], options)
12251225
" the job may be done quickly, also accept "dead"
12261226
call assert_match('^\%(dead\|run\)$', job_status(job))

src/testdir/test_cmd_lists.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func Test_cmd_lists()
5050
\ 'interface',
5151
\ 'public',
5252
\ 'static',
53-
\ 'this',
53+
\ 'this',
5454
\ 'type',
5555
\ '++',
5656
\ '--',

0 commit comments

Comments
 (0)