diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-04-08 12:54:28 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-04-08 12:54:28 +0200 |
| commit | 5babc34721e5f587ecae5bd4432fd57bf8c401fe (patch) | |
| tree | 5086e5c4b31dbb992b8557307c7d44c1b8a3bacf | |
| parent | 14370ac9082c620eeec72e329b808ab3daa8d915 (diff) | |
Replace Makefile with mise.toml
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | Makefile | 30 | ||||
| -rw-r--r-- | generate_json.py | 6 | ||||
| -rw-r--r-- | mise.toml | 44 |
3 files changed, 47 insertions, 33 deletions
diff --git a/Makefile b/Makefile deleted file mode 100644 index df7d850..0000000 --- a/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -debug: - mkdir -p Debug - cmake -DCMAKE_BUILD_TYPE=Debug -B Debug - cmake --build Debug - -release: - mkdir -p Release - cmake -DCMAKE_BUILD_TYPE=Release -B Release - cmake --build Release - -profile: - mkdir -p Profile - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -B Profile - cmake --build Profile - valgrind --tool=callgrind --dump-instr=yes --callgrind-out-file=callgrind.out ./Profile/main 100MB.json 1 - kcachegrind callgrind.out - -test: - fish generate.fish - make debug - ./Debug/test - -format: - clang-format -i src/*.c include/*.h tests/*.c *.c - -check: - clang-format -i --dry-run src/*.c include/*.h tests/*.c *.c --fail-on-incomplete-format - ruff check - ruff format --check - make test diff --git a/generate_json.py b/generate_json.py index 2f0a9d5..90330ac 100644 --- a/generate_json.py +++ b/generate_json.py @@ -185,6 +185,7 @@ def generate_large_json(target_size_mb: int, output_file: str): print(f" Page views: {len(data['analytics']['page_views']):,}") print(f" Server metrics: {len(data['analytics']['server_metrics']):,}") + def generate_descriptive(target_size_mb: int, output_file: str): target_size_bytes = target_size_mb * 1024 * 1024 data = [] @@ -205,9 +206,7 @@ def generate_descriptive(target_size_mb: int, output_file: str): # Estimate current size (approximate: 40+400 chars per object + overhead) current_size = len(data) * (40 + 400 + 30) - if ( - current_size % (10 * 1024 * 1024) < batch_size * (40 + 400) - ): + if current_size % (10 * 1024 * 1024) < batch_size * (40 + 400): print(f"Generated approximately {current_size / (1024 * 1024):.1f}MB...") print(f"Writing to {output_file}...") @@ -222,6 +221,7 @@ def generate_descriptive(target_size_mb: int, output_file: str): print(f" Actual size: {actual_size_mb:.1f}MB ({actual_size:,} bytes)") print(f" Objects: {len(data):,}") + def main(): assert len(sys.argv) == 2 try: diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..af14e2b --- /dev/null +++ b/mise.toml @@ -0,0 +1,44 @@ +[tasks.generate] +run = "fish generate.fish" + +[tasks.debug] +depends = ["generate"] +run = [ + "mkdir -p Debug", + "cmake -DCMAKE_BUILD_TYPE=Debug -B Debug", + "cmake --build Debug" +] + +[tasks.release] +depends = ["generate"] +run = [ + "mkdir -p Release", + "cmake -DCMAKE_BUILD_TYPE=Release -B Release", + "cmake --build Release" +] + +[tasks.profile] +depends = ["generate"] +run = [ + "mkdir -p Profile", + "cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -B Profile", + "cmake --build Profile", + "valgrind --tool=callgrind --dump-instr=yes --callgrind-out-file=callgrind.out ./Profile/main 100MB.json 1", + "kcachegrind callgrind.out" +] + +[tasks.test] +depends = ["debug"] +run = "./Debug/test" + +[tasks.format] +run = "clang-format -i src/*.c include/*.h tests/*.c *.c" + +[tasks.check] +depends = ["debug"] +run = [ + "clang-format --dry-run src/*.c include/*.h tests/*.c *.c --fail-on-incomplete-format", + "ruff check", + "ruff format --check", + "mise run test" +] |
