Problem: test_codestyle does not catch all intended whitespace violations in help files.
Solution: Improve the relevant patterns.
[^/] before <SPACE><TAB> so we can match this at the start of a line.:help 12.7.:help 27.6, this was matching the pattern /[^? ^I]/ rather than the literal text and skipping most of the file.https://github.com/vim/vim/pull/18599
(1 file)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@h-east approved this pull request.
Thanks for fixing my elementary mistake of using a double quote string on the right hand side of the regular expression match.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@dkearns pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
It might be better to explicitly match the existing exceptions for the trailing whitespace test (/\~\s\+$/ and /\\\s\+$/), as there's only six matches in total, and simplify the general pattern to /\s\+$/?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@chrisbra commented on this pull request.
In src/testdir/test_codestyle.vim:
>
# # TODO: Check for line over 80 columns
-# cursor(1, 1)
-# while 1
-# lnum = search('\%>80v.*$')
-# ReportError(fpath, lnum, 'line over 80 columns')
-# if lnum == 0
-# break
-# endif
-# endwhile
+# PerformCheck('\%>80v.*$', 'line over 80 columns')
We could use a skip expression here, so that we don't report errors for overlong lines in helpExamples. Something like this seems to work:
diff --git a/src/testdir/test_codestyle.vim b/src/testdir/test_codestyle.vim
index 46f839c06..d639b8c7d 100644
--- a/src/testdir/test_codestyle.vim
+++ b/src/testdir/test_codestyle.vim
@@ -107,6 +107,7 @@ enddef
def Test_help_files()
var lnum: number
set nowrapscan
syn on
for fpath in glob('../../runtime/doc/*.txt', 0, 1)
g:ignoreSwapExists = 'e'
@@ -151,15 +152,14 @@ def Test_help_files()
endif
endwhile
cursor(1, 1)
while 1
lnum = search('\%>80v.*$', '', 0, 0, () => synIDattr(synID(line("."), col("."), 1), "name") =~# 'helpExample')
ReportError(fpath, lnum, 'line over 80 columns')
if lnum == 0
break
endif
endwhile
It still reports 296 matches with overlong lines :(
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
It still reports 296 matches with overlong lines :(
I only get about 90 and last time I checked most of those were the result of concealed lines being wrapped at their concealed (rendered) length. The prime offenders are long sequences of tags or links, like :help :delete, and example markup at the end of the line >.
We need to decide whether we're going to continue with the current policy that seems to favour wrapping at the concealed length.
Wrapping at the unconcealed length can make the concealed view look rather odd and vice versa.
I'm not sure how I got sucked into this...
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
We need to decide whether we're going to continue with the current policy that seems to favour wrapping at the concealed length.
Yes, that's what we should do.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()