(filenames)
| 68 | |
| 69 | |
| 70 | def warn(filenames): |
| 71 | clang = subprocess.call([clang_format_bin, "-Werror", "--dry-run"] + filenames) |
| 72 | newline = 0 |
| 73 | for filename in filenames: |
| 74 | with open(filename, "rb") as f: |
| 75 | try: |
| 76 | f.seek(-1, os.SEEK_END) |
| 77 | if f.read(1) != b"\n": |
| 78 | print(filename + ": error: missing newline at EOF", file=sys.stderr) |
| 79 | newline = 1 |
| 80 | except OSError: |
| 81 | f.seek(0) |
| 82 | return clang or newline |
| 83 | |
| 84 | |
| 85 | def main(): |