File tree Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Run Test
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - ' *'
7+ push :
8+ branches :
9+ - master
10+
11+ jobs :
12+ test :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Check out repository
17+ uses : actions/checkout@v4
18+
19+ - name : Run test
20+ run : ./run_test.sh
Original file line number Diff line number Diff line change 1+ if empty ($OUTPUT_FILE )
2+ echom " Error: Environment variable OUTPUT_FILE is not set."
3+ cquit ! 1
4+ endif
5+
6+ set nocompatible
7+ set runtimepath ^= $PWD
8+ filetype plugin indent on
9+
10+ syntax on
11+ augroup swiftIndent
12+ autocmd !
13+ autocmd BufRead ,BufNewFile *.swift setlocal shiftwidth = 4 expandtab
14+ augroup END
15+
16+ " Apply autoindent, save and quit.
17+ function ! s: RemoveWhitespaceAndReindent ()
18+ silent % s /^\s\+/ /
19+ normal gg= G
20+ execute ' write ' . fnameescape ($OUTPUT_FILE )
21+ quit !
22+ endfunction
23+ autocmd BufReadPost * call s: RemoveWhitespaceAndReindent ()
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euo pipefail
4+
5+ tempdir=$( mktemp -d)
6+ trap cleanup EXIT
7+
8+ cleanup () {
9+ rm -r " $tempdir "
10+ }
11+
12+ for example_file in example/* .swift; do
13+ autoindented_file=" $tempdir /${example_file##*/ } "
14+ OUTPUT_FILE=" $autoindented_file " vim -u autoindent.vim " $example_file "
15+ diff -u --color=auto " $example_file " " $autoindented_file "
16+ done
17+
18+ echo " test passed!"
You can’t perform that action at this time.
0 commit comments