Commit 028ce54f authored by Michal Čihař's avatar Michal Čihař

Merge branch 'master' into bootstrap

parents 7ebe4133 132491e8
......@@ -36,6 +36,7 @@ SAME_BLACKLIST = frozenset((
'active',
'add-ons',
'addons',
'address',
'admin',
'administration',
'ah',
......@@ -78,6 +79,7 @@ SAME_BLACKLIST = frozenset((
'bluetooth',
'bootloader',
'branch',
'broadcast',
'browser',
'buffer',
'byte',
......@@ -173,6 +175,7 @@ SAME_BLACKLIST = frozenset((
'filter',
'filters',
'finance',
'firewall',
'firmware',
'flash',
'flattr',
......@@ -223,9 +226,11 @@ SAME_BLACKLIST = frozenset((
'http',
'hut',
'hyperlink',
'icmp',
'icon',
'icons',
'id',
'ids',
'idea',
'ignore',
'irc',
......@@ -246,6 +251,7 @@ SAME_BLACKLIST = frozenset((
'innodb',
'ins',
'insert',
'install',
'installation',
'interlingua',
'internet',
......@@ -253,6 +259,8 @@ SAME_BLACKLIST = frozenset((
'introduction',
'ion',
'ios',
'ip6tables',
'iptables',
'irix',
'isbn',
'ismn',
......@@ -287,6 +295,7 @@ SAME_BLACKLIST = frozenset((
'lock',
'local',
'locales',
'logcheck',
'login',
'logo',
'logos',
......@@ -343,6 +352,9 @@ SAME_BLACKLIST = frozenset((
'namecoin',
'namecoins',
'navigation',
'net',
'netfilter',
'network',
'neutral',
'nimh',
'no',
......@@ -397,6 +409,7 @@ SAME_BLACKLIST = frozenset((
'php',
'phpmyadmin',
'pib',
'ping',
'pirate',
'pirates',
'placement',
......@@ -428,6 +441,7 @@ SAME_BLACKLIST = frozenset((
'promotion',
'property',
'properties',
'protocol',
'provider',
'proxy',
'pt',
......@@ -476,6 +490,7 @@ SAME_BLACKLIST = frozenset((
'scripting',
'scroll',
'seed',
'selinux',
'send',
'sergeant',
'serie',
......@@ -496,6 +511,7 @@ SAME_BLACKLIST = frozenset((
'smsd',
'snapshot',
'snapshots',
'snmp',
'socket',
'software',
'solaris',
......@@ -842,6 +858,12 @@ SPLIT_RE = re.compile(
ur'[() ,.^`"\'\\/_<>!?;:|{}*^@%#&~=+\r\n✓—…\[\]0-9-])+'
)
# Docbook tags to ignore
DB_TAGS = (
'screen',
'indexterm',
'programlisting',
)
def strip_format(msg, flags):
'''
......@@ -919,6 +941,12 @@ class SameCheck(TargetCheck):
if result is not None:
return result
# Ignore some docbook tags
if unit.comment.startswith('Tag: '):
if unit.comment[5:] in DB_TAGS:
self.set_cache(unit, True, cache_slot)
return True
# Lower case source
lower_source = source.lower()
......
......@@ -64,7 +64,8 @@ class MockUnit(object):
'''
Mock unit object.
'''
def __init__(self, checksum=None, flags='', code='cs', source=''):
def __init__(self, checksum=None, flags='', code='cs', source='',
comment=''):
if checksum is None:
checksum = str(uuid.uuid1())
self.checksum = checksum
......@@ -73,6 +74,7 @@ class MockUnit(object):
self.source = source
self.fuzzy = False
self.translated = True
self.comment = comment
@property
def all_flags(self):
......
......@@ -46,6 +46,20 @@ class SameCheckTest(CheckTestCase):
0
))
def test_same_db_screen(self):
self.assertTrue(self.check.check_single(
'some long text is here',
'some long text is here',
MockUnit(code='de'),
0
))
self.assertFalse(self.check.check_single(
'some long text is here',
'some long text is here',
MockUnit(code='de', comment='Tag: screen'),
0
))
def test_same_numbers(self):
self.do_test(False, ('1:4', '1:4', ''))
self.do_test(False, ('1, 3, 10', '1, 3, 10', ''))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment