187a188,190
> lang = lang_type(filename)
> assert lang in self.languages
>
193c196
< if not self.check_line(line):
---
> if not self.check_line(line, language=lang):
198a202
> f.close()
203a208,210
> lang = lang_type(filename)
> assert lang in self.languages
>
212c219
< line = self.fix_line(line)
---
> line = self.fix_line(line, language=lang)
216a224
> self.current_language = None
218d225
<
220c227
< def check_line(self, line):
---
> def check_line(self, line, **kwargs):
224c231
< def fix_line(self, line):
---
> def fix_line(self, line, **kwargs):
235c242,245
< languages = set(('C', 'C++', 'swig', 'python', 'asm', 'isa', 'scons'))
---
> languages = set(('C', 'C++', 'swig', 'python', 'asm', 'isa', 'scons',
> 'make', 'dts'))
> trail_only = set(('make', 'dts'))
>
242,245d251
< def check_line(self, line):
< match = Whitespace._lead.search(line)
< if match and match.group(1).find('\t') != -1:
< return False
246a253,261
> def skip_lead(self, language):
> return language in Whitespace.trail_only
>
> def check_line(self, line, language):
> if not self.skip_lead(language):
> match = Whitespace._lead.search(line)
> if match and match.group(1).find('\t') != -1:
> return False
>
253,254c268,269
< def fix_line(self, line):
< if Whitespace._lead.search(line):
---
> def fix_line(self, line, language):
> if not self.skip_lead(language) and Whitespace._lead.search(line):
332c347
< def check_line(self, line):
---
> def check_line(self, line, **kwargs):
336c351
< def fix_line(self, line):
---
> def fix_line(self, line, **kwargs):
346c361
< def check_line(self, line):
---
> def check_line(self, line, **kwargs):
349c364
< def fix(self, filename, regions=all_regions):
---
> def fix(self, filename, regions=all_regions, **kwargs):
363c378
< def check_line(self, line):
---
> def check_line(self, line, **kwargs):
366c381
< def fix_line(self, line):
---
> def fix_line(self, line, **kwargs):
376c391
< def check_line(self, line):
---
> def check_line(self, line, **kwargs):
379c394
< def fix_line(self, line):
---
> def fix_line(self, line, **kwargs):