(root: str)
| 187 | |
| 188 | |
| 189 | def find_c_cpp_files(root: str) -> list[str]: |
| 190 | |
| 191 | result = [] |
| 192 | |
| 193 | for dirpath, dirnames, filenames in os.walk(root): |
| 194 | # I'm assuming other people have checked boost |
| 195 | for name in ("build", ".git", "boost"): |
| 196 | try: |
| 197 | dirnames.remove(name) |
| 198 | except ValueError: |
| 199 | pass |
| 200 | for name in fnmatch.filter(dirnames, "*.p"): |
| 201 | dirnames.remove(name) |
| 202 | result.extend( |
| 203 | [ |
| 204 | os.path.join(dirpath, name) |
| 205 | for name in filenames |
| 206 | if os.path.splitext(name)[1].lower() in C_CPP_EXTENSIONS |
| 207 | ] |
| 208 | ) |
| 209 | # Check the headers before the source files |
| 210 | result.sort(key=lambda path: "h" in os.path.splitext(path)[1], reverse=True) |
| 211 | return result |
| 212 | |
| 213 | |
| 214 | def diff_files(sha: str) -> list[str]: |
no test coverage detected
searching dependent graphs…