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