()
| 147 | |
| 148 | |
| 149 | def main() -> int: |
| 150 | root = repo_root() |
| 151 | os.chdir(root) |
| 152 | |
| 153 | sanitize_permissions(root) |
| 154 | |
| 155 | run_python_step( |
| 156 | "Expanding single-line doxygen comments", root / "scripts" / "expand-doxygen.py" |
| 157 | ) |
| 158 | |
| 159 | print("Running clang-format (pass 1)...") |
| 160 | run_clang_format(root) |
| 161 | |
| 162 | run_python_step("Running code-verify", root / "scripts" / "code-verify.py", "--fix") |
| 163 | |
| 164 | print("Running clang-format (pass 2)...") |
| 165 | run_clang_format(root) |
| 166 | |
| 167 | run_python_step_quiet( |
| 168 | "Regenerating .code-report", root / "scripts" / "code-verify.py", "--check" |
| 169 | ) |
| 170 | |
| 171 | run_black(root) |
| 172 | |
| 173 | run_python_step( |
| 174 | "Running documentation-verify", |
| 175 | root / "scripts" / "documentation-verify.py", |
| 176 | "--quiet", |
| 177 | ) |
| 178 | |
| 179 | run_python_step( |
| 180 | "Regenerating SerialStudio SDK (JS/Lua)", |
| 181 | root / "scripts" / "generate-sdk.py", |
| 182 | ) |
| 183 | |
| 184 | run_python_step( |
| 185 | "Rebuilding AI search index", |
| 186 | root / "app" / "rcc" / "ai" / "build_search_index.py", |
| 187 | ) |
| 188 | |
| 189 | print("Checking for changes...") |
| 190 | changed = capture(["git", "status", "--short"]) |
| 191 | if not changed.strip(): |
| 192 | print("No changes detected.") |
| 193 | return 0 |
| 194 | |
| 195 | print() |
| 196 | print("Changed files:") |
| 197 | sys.stdout.write(changed) |
| 198 | print() |
| 199 | |
| 200 | staged = capture(["git", "diff", "--cached", "--name-only"]).splitlines() |
| 201 | count = len(staged) |
| 202 | if count == 0: |
| 203 | count = len(capture(["git", "diff", "--name-only"]).splitlines()) |
| 204 | print(f"{count} file(s) changed. Review and commit when ready.") |
| 205 | |
| 206 | return 0 |
no test coverage detected