···
# CRUSH Development Guidelines
4
-
- **Run parser**: `./transaction-parser.sh <logfile>`
5
-
- **Test parser**: `./transaction-parser.sh -s <logfile>` (summary mode)
6
-
- **Help**: `./transaction-parser.sh --help`
4
+
- **Build with nix**: `nix build`
5
+
- **Run parser**: `./result/bin/transaction-parser <logfile>`
6
+
- **Test parser**: `./result/bin/transaction-parser -s <logfile>` (summary mode)
7
+
- **Help**: `./result/bin/transaction-parser --help`
8
+
- **Build with clang**: `clang++ -std=c++17 -O3 -o transaction-parser src/transaction-parser.cpp`
9
-
- **Language**: Bash scripting
10
-
- **Shebang**: Use `#!/usr/bin/env nix-shell` with dependencies
11
+
- **Language**: C++17
13
-
- Functions use snake_case
14
-
- Variables use UPPER_CASE
14
+
- Functions use camelCase
15
+
- Classes use PascalCase
16
+
- Variables use camelCase
- Clear function separation
- Help documentation included
18
-
- Error handling with exit codes
19
-
- **Dependencies**: gnugrep, gnused, coreutils (via nix-shell)
20
+
- Error handling with return codes
21
+
- **Dependencies**: Standard C++ libraries only
24
+
- **Nix Flake**: For reproducible builds and development environment
25
+
- **CMake**: For cross-platform build configuration
26
+
- **Compiler**: Clang++ with C++17 standard
- Always validate input files exist
23
-
- Use proper error messages and exit codes
30
+
- Use proper error messages and return codes
- Include comprehensive help documentation
25
-
- Follow tab-separated output format for structured data
26
-
- Handle edge cases in XML parsing
32
+
- Follow pipe-separated output format for structured data
33
+
- Handle edge cases in XML parsing with regex
34
+
- Use STL containers and algorithms for performance
29
-
- Variables: UPPER_CASE
30
-
- Functions: snake_case
31
-
- Files: kebab-case.sh
37
+
- Variables: camelCase
38
+
- Functions: camelCase
39
+
- Classes: PascalCase
40
+
- Files: kebab-case.cpp
- Check file existence before processing
36
-
- Exit with appropriate codes (0 for success, 1 for error)
45
+
- Return appropriate codes (0 for success, 1 for error)
46
+
- Use try/catch blocks for exception handling