| 85 | |
| 86 | |
| 87 | class NewlineLinter(Linter): |
| 88 | msg = 'Contains DOS-style newlines' |
| 89 | # git supports newline conversion. Catch in CI, ignore on Windows. |
| 90 | ignore = os.linesep != '\n' and not os.environ.get('CI') |
| 91 | def check_line(self, line): |
| 92 | return '\r' not in line |
| 93 | def fix_line(self, line): |
| 94 | return line.replace('\r', '') |
| 95 | |
| 96 | class TrailingWhitespaceLinter(Linter): |
| 97 | msg = 'Contains trailing whitespace' |