( path )
| 81 | return out |
| 82 | |
| 83 | def check_file( path ): |
| 84 | root, f = os.path.split(path) |
| 85 | if f in ['.clang-tidy', '.clang-format']: |
| 86 | print("Skipping file: {}".format(path)) |
| 87 | return |
| 88 | |
| 89 | with open(path, 'r', encoding='utf-8') as fd: |
| 90 | content = fd.read() |
| 91 | _, extension = os.path.splitext(f) |
| 92 | |
| 93 | if extension in ['.cpp', '.h', '.hpp', '.inl', '.cl', '.in', '.cs']: |
| 94 | if not content.startswith('/*'): |
| 95 | add_cpp_copyright(path, content) |
| 96 | elif extension == '.py' or f in ['SConstruct', 'SConscript']: |
| 97 | if not content.startswith('# Copyright'): |
| 98 | add_python_copyright(path, content) |
| 99 | elif f == 'CMakeLists.txt': |
| 100 | if not content.startswith('# Copyright'): |
| 101 | add_python_copyright(path, content) |
| 102 | else: |
| 103 | raise Exception("Unhandled file: {}".format(path)) |
| 104 | |
| 105 | if len(sys.argv) > 1: |
| 106 | for path in sys.argv[1:]: |
no test coverage detected