Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
99343629
Commit
99343629
authored
9 years ago
by
timeless
Browse files
Options
Downloads
Patches
Plain Diff
docchecker: report context line at most once
parent
7a1ad08b
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/docchecker
+14
-7
14 additions, 7 deletions
doc/docchecker
with
14 additions
and
7 deletions
doc/docchecker
+
14
−
7
View file @
99343629
...
...
@@ -10,7 +10,12 @@
import
re
leadingline
=
re
.
compile
(
r
'
(^\s*)(\S.*)$
'
)
hg_backtick
=
re
.
compile
(
r
"""
:hg:`[^`]*
'
[^`]*`
"""
)
hg_cramped
=
re
.
compile
(
r
'
\w:hg:`
'
)
checks
=
[
(
r
"""
:hg:`[^`]*
'
[^`]*`
"""
,
"""
warning: please avoid nesting
'
in :hg:`...`
"""
),
(
r
'
\w:hg:`
'
,
'
warning: please have a space before :hg:
'
),
]
def
check
(
line
):
...
...
@@ -15,4 +20,8 @@
def
check
(
line
):
if
hg_backtick
.
search
(
line
):
messages
=
[]
for
match
,
msg
in
checks
:
if
re
.
search
(
match
,
line
):
messages
.
append
(
msg
)
if
messages
:
print
(
line
)
...
...
@@ -18,8 +27,6 @@
print
(
line
)
print
(
"""
warning: please avoid nesting
'
in :hg:`...`
"""
)
if
hg_cramped
.
search
(
line
):
print
(
line
)
print
(
'
warning: please have a space before :hg:
'
)
for
msg
in
messages
:
print
(
msg
)
def
work
(
file
):
(
llead
,
lline
)
=
(
''
,
''
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment