Implement safe cracking logic and setup development environment

- Added a new `main.cpp` file with logic to parse dial rotations from a file and execute safe cracking based on the parsed data.
- Introduced a `DialRotation` struct to represent the direction and distance of dial rotations.
- Implemented `parseRotations` function to read and parse input from a specified file, returning a vector of `DialRotation` or an error message.
- Created `executeSafeCrack` function to process the dial rotations and print the current state of the dial.
- Added `.clang-format` and `.clang-tidy` configuration files for code formatting and linting.
- Set up a Dockerfile for a development container with necessary tools and dependencies.
- Configured VS Code settings and tasks for building, formatting, and running clang-tidy.
- Added a script to run clang-tidy on the source files, ensuring code quality.
This commit is contained in:
Feiko Wielsma 2025-12-01 21:01:09 +00:00
parent c093e8a4bf
commit 38eca3b747
11 changed files with 4654 additions and 3 deletions

9
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,9 @@
{
"editor.formatOnSave": true,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.configureOnOpen": false,
"cmake.generator": "Ninja",
"clangd.arguments": [
"--compile-commands-dir=build"
]
}

33
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,33 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "CMake: Configure",
"type": "shell",
"command": "cmake -S . -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
"problemMatcher": []
},
{
"label": "CMake: Build",
"type": "shell",
"command": "cmake --build build -- -j",
"problemMatcher": []
},
{
"label": "Clang-Format: Format Workspace",
"type": "shell",
"command": "bash -lc \"find . -name \"*.cpp\" -o -name \"*.hpp\" -o -name \"*.h\" | xargs -r clang-format -i\"",
"problemMatcher": []
},
{
"label": "Clang-Tidy: Run",
"type": "shell",
"command": "./scripts/run-clang-tidy.sh",
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
}
]
}