Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions campbot/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ def get_fixed_tests(lang):
RouteTypeTest(),
DistanceTest(),
QualityTest(),
TitleLevel(),
]


Expand Down Expand Up @@ -486,3 +487,24 @@ def __init__(self):

def test_contribution(self, old_doc, new_doc):
return old_doc.quality == new_doc.quality

class TitleLevel(object):
def __init__(self):
self.name = "Titre de niveau trop élevé"
self.fail_marker = emoji("/uploads/default/original/2X/0/0178043b1b70e669946f609571bd4b8f7d18e820.png",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use another icon. you can use HTML. Maybe <strong>H</strong> for fail_marker, and <ins><strong>H</strong></ins> for success_marker ?

self.name)
self.success_marker = ""

def __call__(self, contrib, old_version, new_version):
if old_version is None or new_version is None:
return True, True

old_doc = old_version.document
new_doc = new_version.document

if "redirects_to" in old_doc or "redirects_to" in new_doc:
return True, True

title = not new_doc.search( r"(^|\n)##[^#]") == None
Comment thread
AntoineMarnat marked this conversation as resolved.
Outdated
subtitle = not new_doc.search(r"(^|\n)###*" == None
Comment thread
AntoineMarnat marked this conversation as resolved.
Outdated
return True, not subtitle or title
Comment thread
AntoineMarnat marked this conversation as resolved.
Outdated