CI: Add Typos check and fix some typo

This commit is contained in:
Tinmarino
2023-03-12 01:15:28 -03:00
parent 48ce5b811d
commit 6d4208157d
15 changed files with 103 additions and 59 deletions
+40 -5
View File
@@ -1,19 +1,52 @@
# Copied from previous .travis.yml by tinmarino the 2023-03-09
name: Automatic regression test with Vim's Vader and Vint
# Commented out to avoid verbosity on github commit status
#name: Main
#description: Vimwiki CI test bank
run-name: Vimwiki Automatic Regression Test
on: [push, workflow_dispatch]
on: [push, pull_request, workflow_dispatch]
jobs:
Typos:
# Copyed from: https://github.com/junegunn/fzf/blob/master/.github/workflows/typos.yml
name: Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: crate-ci/typos@v1.13.16
with:
config: ./test/resources/typos_config.toml
Vint:
# Copyed from: https://github.com/LudvigHz/vint-action
# And local test/run_test.sh
name: Vint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ludvighz/vint-action@v1
with:
path: .
args: --style-problem
- uses: ludvighz/vint-action@v1
with:
path: test/vimrc
args: --style-problem
Check:
name: Check ${{ matrix.opt }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
opt: [
"vint",
#"vint",
"-n vim_7.3.429",
"-n vim_8.1.0519",
@@ -33,6 +66,8 @@ jobs:
steps:
# This action is required to fetch the code to test
- uses: actions/checkout@v3
with:
fetch-depth: 0
# This action is crafting the docker image from the root Docker file
# or will use it is exists in cache
+17 -17
View File
@@ -664,7 +664,7 @@ function! vimwiki#base#get_anchors(filename, syntax) abort
let h_match = matchlist(line, rxheader)
if !empty(h_match)
let header = vimwiki#base#normalize_anchor(h_match[2])
" Mesure: header level
" Measure: header level
let level = len(h_match[1])
call add(anchors, header)
let anchor_level[level-1] = header
@@ -755,7 +755,7 @@ function! vimwiki#base#normalize_anchor(anchor, ...) abort
" 4 Append '-1', '-2', '-3',... to make it unique <= If that not unique
if has_key(previous_anchors, anchor)
" Inc anchor number (before modifing the anchor)
" Inc anchor number (before modifying the anchor)
let anchor_nb = previous_anchors[anchor] + 1
let previous_anchors[anchor] = anchor_nb
" Append suffix
@@ -816,7 +816,7 @@ function! vimwiki#base#unnormalize_anchor(anchor) abort
" For each char
let anchor_loop = ''
for char in split(anchor, '\zs')
" Nest the char for easyer debugging
" Nest the char for easier debugging
let anchor_loop .= '\%('
" 3 Change any space to a hyphen
@@ -825,7 +825,7 @@ function! vimwiki#base#unnormalize_anchor(anchor) abort
let anchor_loop .= invisible_rx.'\+'
" 2 Remove anything that is not a letter, number, CJK character, hyphen or space
" -- So add puncutation regex at each char
" -- So add punctuation regex at each char
else
" Match My_char . punctuation . ( link . punctuaction )?
" Note: Because there may be punctuation before ad after link
@@ -847,7 +847,7 @@ endfunction
function! s:jump_to_anchor(anchor) abort
" Jump: to anchor, doing the oposite of normalize_anchor
" Jump: to anchor, doing the opposite of normalize_anchor
" Called: edit_file
" Get segments <= anchor
let anchor = vimwiki#u#escape(a:anchor)
@@ -886,7 +886,7 @@ function! s:jump_to_segment(segment, segment_norm_re, segment_nb) abort
\ vimwiki#vars#get_syntaxlocal('tag_match'),
\ '__Tag__', a:segment, 'g')
" Go: Move cursor: maybe more than onces (see markdown suffix)
" Go: Move cursor: maybe more than once (see markdown suffix)
let success_nb = 0
let is_last_segment = 0
for i in range(a:segment_nb)
@@ -898,7 +898,7 @@ function! s:jump_to_segment(segment, segment_norm_re, segment_nb) abort
" Succeed: Get the result and reloop or leave
if pos != 0
" Avance, one line more to not rematch the same pattern if not last segment_nb
" Advance, one line more to not rematch the same pattern if not last segment_nb
if success_nb < a:segment_nb-1
let pos += 1
let is_last_segment = -1
@@ -1102,7 +1102,7 @@ endfunction
function! vimwiki#base#edit_file(command, filename, anchor, ...) abort
" Edit File: (like :e)
" :param: command <string>: ':e'
" :param: filename <strign> vimwiki#vars#get_wikilocal('path') . key . vimwiki#vars#get_wikilocal('ext')
" :param: filename <string> vimwiki#vars#get_wikilocal('path') . key . vimwiki#vars#get_wikilocal('ext')
" :param: anchor
" :param: (1) vimwiki_prev_link
" :param: (2) vimwiki#u#ft_is_vw()
@@ -1117,7 +1117,7 @@ function! vimwiki#base#edit_file(command, filename, anchor, ...) abort
endif
" Check if the file we want to open is already the current file
" which happens if we jump to an achor in the current file.
" which happens if we jump to an anchor in the current file.
" This hack is necessary because apparently Vim messes up the result of
" getpos() directly after this command. Strange.
if !(a:command =~# ':\?[ed].*' && vimwiki#path#is_equal(a:filename, expand('%:p')))
@@ -1425,7 +1425,7 @@ function! vimwiki#base#nested_syntax(filetype, start, end, textSnipHl) abort
" attempting to include them.
" https://vi.stackexchange.com/a/10354
" Previously, this used a try/catch block to intercept any errors thrown
" when attempting to include files. The error(s) interferred with running
" when attempting to include files. The error(s) interfered with running
" with Vader tests (specifically, testing VimwikiSearch).
if !empty(globpath(&runtimepath, 'syntax/'.a:filetype.'.vim'))
execute 'syntax include @'.group.' syntax/'.a:filetype.'.vim'
@@ -1655,7 +1655,7 @@ function! vimwiki#base#follow_link(split, ...) abort
\ vimwiki#vars#get_syntaxlocal('rxWeblinkMatchUrl'))
if lnk !=# ''
if lnk !~# '\%(\%('.vimwiki#vars#get_global('schemes_web').'\):\%(\/\/\)\?\)\S\{-1,}'
" prepend file: scheme so link is opened by sytem handler if it isn't a web url
" prepend file: scheme so link is opened by system handler if it isn't a web url
let lnk = 'file:'.lnk
endif
endif
@@ -1968,7 +1968,7 @@ function! vimwiki#base#rename_file(...) abort
else
" Should not happen
call vimwiki#u#error('New buffer is the same as old, so will not delete: '
\ . buf_new_nb . '.Please open an issue if see this messsage')
\ . buf_new_nb . '.Please open an issue if see this message')
endif
" Log success
@@ -2505,7 +2505,7 @@ function! vimwiki#base#table_of_contents(create) abort
" copy all local variables into dict (add a: if arguments are needed)
let GeneratorTOC = copy(l:)
function! GeneratorTOC.f() abort
" Clean heading informations
" Clean heading information
let numbering = vimwiki#vars#get_global('html_header_numbering')
" TODO numbering not used !
let headers_levels = [['', 0], ['', 0], ['', 0], ['', 0], ['', 0], ['', 0]]
@@ -2668,7 +2668,7 @@ function! vimwiki#base#normalize_link_helper(str, rxUrl, rxDesc, template) abort
let descr = s:clean_url(url)
if descr ==# '' | return url | endif
endif
" Substiture placeholders
" Substitute placeholders
let lnk = s:safesubstitute(a:template, '__LinkDescription__', descr, '')
let lnk = s:safesubstitute(lnk, '__LinkUrl__', url, '')
let file_extension = vimwiki#vars#get_wikilocal('ext', vimwiki#vars#get_bufferlocal('wiki_nr'))
@@ -2846,7 +2846,7 @@ endfunction
function! vimwiki#base#complete_file(ArgLead, CmdLine, CursorPos) abort
" Complete filename relatie to current file
" Complete filename relative to current file
" Called: rename_file
" Start from current file
let base_path = expand('%:h')
@@ -2913,7 +2913,7 @@ function! s:get_title(match) abort
" Do not overwrite if g:page_title is already set
" when there are multiple <title> tags, only use the first one
" this is a side effect of the substitute's 'n' flag (count number of
" occurences and evaluate \= for each one
" occurrences and evaluate \= for each one
if (g:page_title !=# '')
return
endif
@@ -3018,7 +3018,7 @@ function! vimwiki#base#colorize(...) range abort
" TODO Must be coherent with color_tag_template
" Arg1: Key, list them with VimwikiColorize completion
" Arg2: visualmode()
" -- Just removeing spaces, \/ -> /, replacing COLORFG will do it
" -- Just removing spaces, \/ -> /, replacing COLORFG will do it
let key = a:0 ? a:1 : 'default'
let mode = a:0 > 1 ? a:2 : ''
let color_dic = vimwiki#vars#get_wikilocal('color_dic')
+2 -2
View File
@@ -184,7 +184,7 @@ endfunction
function! s:read_captions(files) abort
" Read all cpation in 1. <List>files
" Read all caption in 1. <List>files
" Return: <Dic>: key -> caption
let result = {}
let caption_level = vimwiki#vars#get_wikilocal('diary_caption_level')
@@ -452,7 +452,7 @@ function! vimwiki#diary#generate_diary_section() abort
let extension = vimwiki#vars#get_wikilocal('ext', wiki_nr)
let entry = substitute(entry, '__FileExtension__', extension, 'g')
" If single H1 then that will be used as the description for the link to the file
" if multple H1 then the filename will be used as the description for the link to the
" if multiple H1 then the filename will be used as the description for the link to the
" file and multiple H1 headers will be indented by shiftwidth
call add(lines, repeat(' ', vimwiki#lst#get_list_margin()).bullet.entry)
+2 -2
View File
@@ -10,7 +10,7 @@ endif
let g:loaded_vimwiki_html_auto = 1
" FIXME: Magics: Why not use the current syntax highlight
" This is due to historical copy paste and lazyness of markdown user
" This is due to historical copy paste and laziness of markdown user
" text: *strong*
" let s:default_syntax.rxBold = '\*[^*]\+\*'
let s:rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
@@ -1081,7 +1081,7 @@ function! s:process_tag_list(line, lists, lstLeadingSpaces) abort
return [processed, lines, lstLeadingSpaces]
endif
" Can embeded indented code in list (Issue #55)
" Can embedded indented code in list (Issue #55)
let b_permit = in_list
let blockquoteRegExp = '^\s\{' . (lstLeadingSpaces + 2) . ',}[^[:space:]>*-]'
let b_match = lstSym ==# '' && a:line =~# blockquoteRegExp
+1 -1
View File
@@ -17,7 +17,7 @@ function! s:windowsify(path) abort
endfunction
" Define: os specific path convertion
" Define: os specific path conversion
if vimwiki#u#is_windows()
function! s:osxify(path) abort
return s:windowsify(a:path)
+1 -1
View File
@@ -247,7 +247,7 @@ function! s:tags_entry_cmp(i1, i2) abort
"
" This function is needed for tags sorting, since plain sort() compares line
" numbers as strings, not integers, and so, for example, tag at line 14
" preceeds the same tag on the same page at line 9. (Because string "14" is
" precedes the same tags on the same page at line 9. (Because string "14" is
" alphabetically 'less than' string "9".)
let items = []
for orig_item in [a:i1, a:i2]
+5 -5
View File
@@ -53,9 +53,9 @@ function! vimwiki#u#deprecate(old, new) abort
endfunction
function! vimwiki#u#get_selection(...) abort
" Get visual selection text content, optionaly replace its content
" Get visual selection text content, optionally replace its content
" :param: Text to replace selection
" Copyed from DarkWiiPlayer at stackoverflow
" Copied from DarkWiiPlayer at stackoverflow
" https://stackoverflow.com/a/47051271/2544873
" Get selection extremity position,
" Discriminate selection mode
@@ -271,7 +271,7 @@ endfunction
function! vimwiki#u#get_syntax_dic(...) abort
" Helper: Getter
" :param: syntax <string> to retrive, default to current
" :param: syntax <string> to retrieve, default to current
let syntax = a:0 ? a:1 : vimwiki#vars#get_wikilocal('syntax')
return g:vimwiki_syntaxlocal_vars[syntax]
endfunction
@@ -315,7 +315,7 @@ function! vimwiki#u#hi_expand_regex(lst) abort
let r_right_del = a_delimiter[1]
" Regex Start:
" Left-Flanking is not followed by space (or ned of line)
" Left-Flanking is not followed by space (or need of line)
let r_left_prefix = '\%(^\|[[:space:]]\@<=\)'
let r_left_prefix = '\\\@<!'
" -- not followed by Unicode whitespace,
@@ -398,7 +398,7 @@ function! vimwiki#u#hi_typeface(dic) abort
" The last syntax defined take precedence so that user can change at runtime (:h :syn-define)
" Some cases are contained by default:
" -- ex: VimwikiCodeBoldUnderline is not defined in colorschemes -> VimwikiCode
" -- see: #709 asking for concealing quotes in bold, so it must be higlighted differently
" -- see: #709 asking for concealing quotes in bold, so it must be highlighted differently
" -- -- for the user to understand what is concealed around
" VimwikiCheckBoxDone and VimwikiDelText are as their are even when nested in bold or italic
" -- This is because it would add a lot of code (as n**2) at startup and is not often used
+4 -4
View File
@@ -43,7 +43,7 @@ endfunction
function! s:check_users_value(key, users_value, value_infos, comes_from_global_variable) abort
" Helper: Check user setting
" warn user with message if not good type
" Param: 1: key <string>: varaible name
" Param: 1: key <string>: variable name
" Param: 2: vimwiki_key <obj>: user value
" Param: 3: value_infod <dict>: type and default value
" Param: 4: coming from a global variable <bool>
@@ -857,7 +857,7 @@ function! vimwiki#vars#populate_syntax_vars(syntax) abort
call s:extend_local(syntax_dic, default_dic, syntax_dic, g:vimwiki_syntax_list[a:syntax])
endif
" TODO make that clean (i.e clearify what is local to syntax ot to buffer)
" TODO make that clean (i.e clarify what is local to syntax or to buffer)
" Get from local vars
let bullet_types = vimwiki#vars#get_wikilocal('bullet_types')
if !empty(bullet_types)
@@ -927,7 +927,7 @@ function! vimwiki#vars#populate_syntax_vars(syntax) abort
\ '^\s*\('.header_symbol.'\{1,6}\)\zs[^'.header_symbol.'].*[^'.header_symbol.']\ze\1\s*$'
else
" asymmetric
" Note: For markdown rxH=# and asymetric
" Note: For markdown rxH=# and asymmetric
for i in range(1,6)
let syntax_dic['rxH'.i.'_Template'] =
\ repeat(header_symbol, i).' __Header__'
@@ -941,7 +941,7 @@ function! vimwiki#vars#populate_syntax_vars(syntax) abort
\ '^\s*'.header_symbol.'\{1,'.i.'}[^'.header_symbol.'].*$\|\%$'
endfor
" Define header regex
" -- ATX heading := preceed by #*
" -- ATX heading := preceded by #*
let atx_heading = '^\s*\%('.header_symbol.'\{1,6}\)'
let atx_heading .= '\zs[^'.header_symbol.'].*\ze$'
let syntax_dic.rxHeader = atx_heading
+4 -4
View File
@@ -53,7 +53,7 @@ random edit.
The lowest row gets aligned when leaving the Insert mode. Let's copy _Data1_
(using `viwy` or another keystroke) and paste it (using `p`) in the second data
row of the first column. Now the table looks mis-aligned (as we did not enter
row of the first column. Now the table looks misaligned (as we did not enter
the Insert mode).
```
@@ -123,7 +123,7 @@ Let's take the table from the previous example in an intermediate state.
```
Then move the cursor to the first data row, copy it with `yy`, go down to the
mis-aligned line, and press `5p`. Now we have a slightly bigger mis-aligned
misaligned line, and press `5p`. Now we have a slightly bigger misaligned
table.
```
@@ -178,8 +178,8 @@ row by row from the top to the bottom, dynamic formatting should be both fast
(watching only three rows in a table, re-formatting only when the shrunk
current row gets longer than any of the two rows above) and eager (a table
should look formatted on every press on _Tab_ and _Enter_). However, the newer
algorithm differs from the older algorithm when starting editing a mis-aligned
table in an area where mis-aligned rows do not get into the viewport: in this
algorithm differs from the older algorithm when starting editing a misaligned
table in an area where misaligned rows do not get into the viewport: in this
case the newer algorithm will format the table partly (in the rows of the
viewport) until one of the being edited cells grows in length to a value big
enough to trigger the older algorithm and the whole table gets aligned. When
+10 -10
View File
@@ -1426,7 +1426,7 @@ Use {{{ and }}} to define a block of preformatted text:
In what distant deeps or skies
Burnt the fire of thine eyes?
On what wings dare he aspire?
What the hand dare sieze the fire?
What the hand dare seize the fire?
}}}
@@ -2695,7 +2695,7 @@ Key Default value~
cycle_bullets 0
If set to 1 (true), cycle through |bullet_types| when changing list element
identation
indentation
*vimwiki-option-generated_links_caption*
@@ -2703,7 +2703,7 @@ identation
Key Default value~
generated_links_caption 0
Default syntax only. If set to 1 (true), use the [[URL|DESCRIPTIOM]] when
Default syntax only. If set to 1 (true), use the [[URL|DESCRIPTION]] when
calling |:VimwikiGenerateLinks|. DESCRIPTION will be the first header in the
corresbonding file found in the first n lines, where n is set by
|g:vimwiki_max_scan_for_caption| (Default 5). If no caption is found fallback
@@ -3291,8 +3291,8 @@ small screens. If |g:vimwiki_table_auto_fmt| is set to 0, this option has no
effect.
Value Description~
0 Enable table auto formating for all columns.
1 Disable table auto formating for the last column.
0 Enable table auto formatting for all columns.
1 Disable table auto formatting for the last column.
Default: 0
@@ -3778,7 +3778,7 @@ The default is %%%s.
Bitfield: Enable/disable emoji conceal and complete
Note that the |completefunc| is only set if it does not exists already to keep
other plugin works by default. It can be set it manualy with: >
other plugin works by default. It can be set it manually with: >
set completefunc=vimwiki#emoji#complete
To replace emoji alias (like :cat:) by their value (like 🐱) in current file: >
@@ -4090,10 +4090,10 @@ Fixed:~
* Issue #894: Make all appropriate settings wikilocal (many commits)
* PR #902: Doc: Darken logo text
* PR #895: Fix: File extension for markdown -> syntax wide
__FileExtention__ keyword appears
__FileExtension__ keyword appears
* PR #963: Doc: Replace VimwikiListChangeLevel references in doc with
VimwikiListChangeLvl as defined by command
* PR #900: conceallevel is now setted locally for vimwiki buffers
* PR #900: conceallevel is now set locally for vimwiki buffers
* Issue #942: Fixing wrong html link conversion in windows
* PR #919: Fix duplicate helptag
* PR #959: Fix :VimwikiNextTask
@@ -4151,7 +4151,7 @@ New:~
sections. New option |g:vimwiki_links_header_level| and
|g:vimwiki_tags_header_level| which allow the header level (1-6) of the
generated links to be set. New option |g:vimwiki_markdown_header_style|
which specifies the nuber of newlines after the created header for
which specifies the number of newlines after the created header for
generated sections.
* PR #635: Wiki local options |vimwiki-option-auto_generate_links| and
|vimwiki-option-auto_generate_tags|.
@@ -4198,7 +4198,7 @@ Fixed:~
* Issue #90: |:VimwikiRenameFile| doesn't update links in diary.
* Issue #790: Allow tags before a header with markdown syntax.
* Issue #779: Vimwiki tags file meets ctags standard.
* Issue #781: Compatablity fixes for older versions of Vim.
* Issue #781: Compatibility fixes for older versions of Vim.
* Issue #691: Allow |:VimwikiGoBackLink| to go back multiple times.
* Update MathJax CDN loading instructions.
* Issue #212: Don't treat comment characters within code blocks as
+3 -3
View File
@@ -3,7 +3,7 @@
" Home: https://github.com/vimwiki/vimwiki/
" Clause: load only onces per buffer
" Clause: load only once per buffer
if exists('b:did_ftplugin')
finish
endif
@@ -160,7 +160,7 @@ setlocal formatoptions-=2
setlocal formatoptions+=c
" Do not wrap if line was already long
setlocal formatoptions+=l
" AutoWrap inteligent with lists
" AutoWrap intelligent with lists
setlocal formatoptions+=n
let &formatlistpat = vimwiki#vars#get_wikilocal('rxListItem')
" Used to join 'commented' lines (blockquote, list) (see: #915)
@@ -222,7 +222,7 @@ endfunction
" (so that -s:tolerance <= spare <= s:tolerance, "string" ends with s:ellipsis)
" Return: [string, spare]
function! s:shorten_text(text, len) abort
" strlen() returns lenght in bytes, not in characters, so we'll have to do a
" strlen() returns length in bytes, not in characters, so we'll have to do a
" trick here -- replace all non-spaces with dot, calculate lengths and
" indexes on it, then use original string to break at selected index.
let text_pattern = substitute(a:text, '\m\S', '.', 'g')
+2 -2
View File
@@ -4,7 +4,7 @@
" GetLatestVimScripts: 2226 1 :AutoInstall: vimwiki
" Clause: load only onces
" Clause: load only once
if exists('g:loaded_vimwiki') || &compatible
finish
endif
@@ -20,7 +20,7 @@ let s:plugin_dir = expand('<sfile>:p:h:h')
let s:old_cpo = &cpoptions
set cpoptions&vim
" Save autowriteall varaible state
" Save autowriteall variable state
if exists('g:vimwiki_autowriteall')
let s:vimwiki_autowriteall_saved = g:vimwiki_autowriteall
else
+3 -3
View File
@@ -24,7 +24,7 @@ call vimwiki#vars#populate_syntax_vars(s:current_syntax)
let syntax_dic = g:vimwiki_syntaxlocal_vars[s:current_syntax]
" Declare nesting capabilities
" -- to be embeded in standard: bold, italic, underline
" -- to be embedded in standard: bold, italic, underline
" text: `code` or ``code`` only inline
" Note: `\%(^\|[^`]\)\@<=` means after a new line or a non `
@@ -316,7 +316,7 @@ for [color_key, color_value] in items(color_dic)
\ . ' ' . b:vimwiki_syntax_concealends
execute cmd
" Build hightlight command
" Build highlight command
let cmd = 'hi Vimwiki' . color_key
if fg !=# ''
let cmd .= ' guifg=' . fg
@@ -471,7 +471,7 @@ hi def link VimwikiSubScriptChar VimwikiMarkers
hi def link VimwikiCodeChar VimwikiMarkers
hi def link VimwikiHeaderChar VimwikiMarkers
" TODO remove unsued due to region refactoring
" TODO remove unused due to region refactoring
hi def link VimwikiEqInCharT VimwikiMarkers
hi def link VimwikiBoldCharT VimwikiMarkers
hi def link VimwikiItalicCharT VimwikiMarkers
+6
View File
@@ -0,0 +1,6 @@
files.extend-exclude = ["test", "autoload/vimwiki/emoji.vim", "doc/vimwiki-emoji.txt"]
[default.extend-words]
# For the fo-table
fo = "fo"
Gude = "Gude"
+3
View File
@@ -165,4 +165,7 @@ Execute (Assert Syntax):
AssertEqual 'VimwikiItalic', SyntaxAt(1, 7)
# Rule 3 {{{1
# TODO Test 3
# vim: foldmethod=marker foldlevel=30 sw=2