|
1 | 1 | import os |
| 2 | +import pathlib |
2 | 3 |
|
| 4 | +import config |
3 | 5 | from diff import gen_diff |
4 | 6 | from index import gen_index |
5 | 7 | from utils import check_call |
6 | 8 | import shutil |
7 | 9 |
|
8 | 10 |
|
9 | 11 | def debug_main(): |
10 | | - # pull some repos for test |
11 | | - check_call(["git", "clone", "--depth=2", "https://github.com/gin-gonic/gin.git"]) |
12 | | - |
13 | | - gen_index("golang", "gin", "") |
| 12 | + # clone junit4 repository |
| 13 | + check_call( |
| 14 | + ["git", "clone", "--depth=2", "https://github.com/junit-team/junit4.git"] |
| 15 | + ) |
| 16 | + junit4_dir = pathlib.Path(config.USER_DIR) / "junit4" |
| 17 | + gen_index( |
| 18 | + "java", |
| 19 | + junit4_dir.as_posix(), |
| 20 | + "scip-java index -- " |
| 21 | + "package -DskipTests " |
| 22 | + "--batch-mode " |
| 23 | + "--errors " |
| 24 | + "--settings .github/workflows/settings.xml", |
| 25 | + ) |
| 26 | + os.chdir(junit4_dir) |
| 27 | + gen_diff(junit4_dir.as_posix(), "HEAD~1", "HEAD", "") |
| 28 | + os.chdir(config.USER_DIR) |
| 29 | + shutil.rmtree(junit4_dir) |
14 | 30 |
|
15 | | - os.chdir("gin") |
16 | | - gen_diff("HEAD~1", "HEAD", "") |
17 | | - os.chdir("..") |
| 31 | + # clone gin repository |
| 32 | + check_call(["git", "clone", "--depth=2", "https://github.com/gin-gonic/gin.git"]) |
| 33 | + gin_dir = pathlib.Path(config.USER_DIR) / "gin" |
| 34 | + os.chdir(gin_dir) |
| 35 | + gen_index("golang", gin_dir.as_posix(), "") |
| 36 | + gen_diff(gin_dir.as_posix(), "HEAD~1", "HEAD", "") |
| 37 | + os.chdir(config.USER_DIR) |
| 38 | + shutil.rmtree(gin_dir) |
18 | 39 |
|
19 | | - # clean up |
20 | | - shutil.rmtree("gin") |
| 40 | + # clone requests repository |
| 41 | + check_call(["git", "clone", "--depth=2", "https://github.com/psf/requests.git"]) |
| 42 | + requests_dir = pathlib.Path(config.USER_DIR) / "requests" |
| 43 | + os.chdir(requests_dir) |
| 44 | + gen_index("python", requests_dir.as_posix(), "") |
| 45 | + gen_diff(requests_dir.as_posix(), "HEAD~1", "HEAD", "") |
| 46 | + os.chdir(config.USER_DIR) |
| 47 | + shutil.rmtree(requests_dir) |
0 commit comments