1
0
mirror of https://github.com/danog/tl-schema.git synced 2024-11-30 04:19:47 +01:00

Add duplicate detection to lint

This commit is contained in:
Viktor Oreshkin 2017-08-16 13:28:26 +03:00
parent fb4f914550
commit d785dbad43

View File

@ -271,6 +271,12 @@ class TLFile:
print('RECURSION ERROR: ') print('RECURSION ERROR: ')
print(tl_type, end='\n\n') print(tl_type, end='\n\n')
for dupe_method in (x for n, x in enumerate(self.methods) if x in self.methods[:n]):
print('ERR: DUPE METHOD -- {}#{}'.format(dupe_method.name, dupe_method.crc2hex(dupe_method.crc)))
for dupe_constructor in (x for n, x in enumerate(self.constructors) if x in self.constructors[:n]):
print('ERR: DUPE CONSTR -- {}#{}'.format(dupe_constructor.name, dupe_constructor.crc2hex(dupe_constructor.crc)))
def diff(self, old, just_added=False, no_changed=False): def diff(self, old, just_added=False, no_changed=False):
ret = { 'added': TLFile() } ret = { 'added': TLFile() }
if not just_added: if not just_added: