Skip to content

Commit 696b874

Browse files
Init Default Project
0 parents  commit 696b874

13 files changed

Lines changed: 507 additions & 0 deletions

File tree

.clang-format

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
# Wir definieren die Sprache
3+
Language: Cpp
4+
5+
# Basis-Stil ist LLVM (sehr sauberer Standard)
6+
BasedOnStyle: LLVM
7+
8+
# --- Wichtigste Anpassungen ---
9+
10+
# C++ Standard (wir nutzen C++20 Features)
11+
Standard: c++20
12+
13+
# Einrückung: 4 Leerzeichen (der Industriestandard)
14+
IndentWidth: 4
15+
TabWidth: 4
16+
UseTab: Never
17+
18+
# Zeilenlänge: 120 Zeichen (80 ist veraltet)
19+
ColumnLimit: 120
20+
21+
# Zeiger-Bindung: int* ptr (Links) statt int *ptr (Rechts)
22+
# C++ Entwickler bevorzugen meist Links, da der Typ "int-Zeiger" ist.
23+
PointerAlignment: Left
24+
25+
# Klammern: "Attach" bedeutet { steht in der gleichen Zeile.
26+
# Beispiel: void foo() {
27+
# Alternative: "Allman" (für { in neuer Zeile)
28+
BreakBeforeBraces: Attach
29+
30+
# --- Feinheiten für Sauberkeit ---
31+
32+
# Zugriffsspezifizierer (public/private) um 4 Stellen ausrücken (auf Ebene von class)
33+
AccessModifierOffset: -4
34+
35+
# Namespaces nicht einrücken (spart Platz bei tiefen Verschachtelungen)
36+
NamespaceIndentation: None
37+
38+
# Includes sortieren und gruppieren (C++ Standard, 3rd Party, Eigene)
39+
SortIncludes: true
40+
IncludeBlocks: Regroup
41+
42+
# Kurze Funktionen (Getter/Setter) dürfen in einer Zeile stehen
43+
AllowShortFunctionsOnASingleLine: Inline
44+
45+
# Switch-Case Einrückung
46+
IndentCaseLabels: true
47+
48+
# Leerzeichen in Klammern entfernen: f( a ) -> f(a)
49+
SpacesInParentheses: false
50+
51+
# Leerzeichen vor Zuweisungen: int a = 1;
52+
SpaceBeforeAssignmentOperators: true
53+
54+
# Nach // Kommentar 2 Leerzeichen Abstand zum Code
55+
SpacesBeforeTrailingComments: 2
56+
57+
# Verhindert, dass Parameterlisten unschön zerhackt werden
58+
BinPackArguments: true
59+
BinPackParameters: true
60+
...

.clang-tidy

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
# Wir prüfen Header und Sources
3+
Checks: >
4+
-*,
5+
bugprone-*,
6+
cert-*,
7+
clang-analyzer-*,
8+
cppcoreguidelines-*,
9+
modernize-*,
10+
performance-*,
11+
portability-*,
12+
readability-*,
13+
-modernize-use-trailing-return-type,
14+
-cppcoreguidelines-avoid-magic-numbers
15+
16+
# Warnungen als Fehler behandeln (für CI wichtig, lokal evtl. nervig)
17+
WarningsAsErrors: ''
18+
19+
# C++ Standard Header Optionen
20+
CheckOptions:
21+
- key: readability-identifier-naming.ClassCase
22+
value: CamelCase
23+
...

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: C++ Professional CI
2+
3+
# Wann soll die Action laufen?
4+
on:
5+
push:
6+
branches: [ "main", "master" ]
7+
pull_request:
8+
branches: [ "main", "master" ]
9+
10+
jobs:
11+
build-and-test:
12+
runs-on: ubuntu-latest
13+
14+
env:
15+
CXX: clang++
16+
CC: clang
17+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
18+
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v4
22+
23+
- name: Install Dependencies
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y \
27+
clang \
28+
clang-tidy \
29+
clang-format \
30+
llvm \
31+
ninja-build \
32+
cppcheck \
33+
python3-pip \
34+
libgtest-dev
35+
36+
pip3 install flawfinder
37+
38+
- name: Install Snyk
39+
uses: snyk/actions/setup@master
40+
41+
- name: Cache CMake dependencies
42+
uses: actions/cache@v3
43+
with:
44+
path: build/_deps
45+
key: ${{ runner.os }}-cmake-${{ hashFiles('**/CMakeLists.txt') }}
46+
restore-keys: |
47+
${{ runner.os }}-cmake-
48+
49+
- name: Configure CMake
50+
run: make reconfig
51+
52+
- name: Clang-Tidy Check
53+
run: make lint
54+
55+
- name: Cppcheck Analysis
56+
run: make analyze
57+
58+
- name: Flawfinder Security Scan
59+
run: make security-code
60+
61+
- name: Build and Test
62+
run: make test
63+
64+
- name: Generate Coverage Report
65+
run: make coverage
66+
67+
- name: Verify Code Formatting
68+
run: make check-format
69+
70+
- name: Snyk Dependency Scan
71+
if: env.SNYK_TOKEN != ''
72+
run: make security-check

.github/workflows/release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build & Release Packages
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
name: Build for ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- os: ubuntu-latest
17+
artifact_name: Linux-Packages
18+
cpack_gen: "DEB;RPM;TGZ"
19+
20+
- os: windows-latest
21+
artifact_name: Windows-Packages
22+
cpack_gen: "ZIP"
23+
24+
- os: macos-latest
25+
artifact_name: macOS-Packages
26+
cpack_gen: "DragNDrop"
27+
28+
steps:
29+
- name: Checkout Code
30+
uses: actions/checkout@v4
31+
32+
# --- Setup Tools ---
33+
- name: Install Tools (Linux)
34+
if: runner.os == 'Linux'
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y ninja-build rpm
38+
39+
- name: Install Tools (Windows)
40+
if: runner.os == 'Windows'
41+
uses: ilammy/msvc-dev-cmd@v1
42+
43+
- name: Install Tools (macOS)
44+
if: runner.os == 'macOS'
45+
run: brew install ninja
46+
47+
# --- Build Process ---
48+
49+
- name: Configure CMake
50+
run: cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release
51+
52+
- name: Build Project
53+
run: cmake --build build --config Release
54+
55+
- name: Run Tests
56+
run: cd build && ctest -C Release --output-on-failure
57+
58+
# --- Packaging (CPack) ---
59+
60+
- name: Generate Packages
61+
run: |
62+
cd build
63+
cpack -C Release -G ${{ matrix.cpack_gen }}
64+
65+
# --- Upload ---
66+
67+
- name: Upload Artifacts
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: ${{ matrix.artifact_name }}
71+
path: |
72+
build/*.deb
73+
build/*.rpm
74+
build/*.tar.gz
75+
build/*.zip
76+
build/*.dmg
77+
78+
# Erstellt automatisch einen "GitHub Release" Eintrag und hängt die Dateien an
79+
- name: Create GitHub Release
80+
uses: softprops/action-gh-release@v1
81+
if: startsWith(github.ref, 'refs/tags/')
82+
with:
83+
files: |
84+
build/*.deb
85+
build/*.rpm
86+
build/*.tar.gz
87+
build/*.zip
88+
build/*.dmg

.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# --- Build & Compiled Output ---
2+
# Dein Haupt-Build-Ordner aus dem Makefile
3+
/build/
4+
# Andere gängige CMake-Build-Ordner (falls Kollegen CLion nutzen)
5+
/cmake-build-*/
6+
/bin/
7+
/lib/
8+
9+
# Kompilierte Objekt-Dateien
10+
*.o
11+
*.obj
12+
*.so
13+
*.a
14+
*.dylib
15+
*.dll
16+
17+
# --- CMake Specifics ---
18+
CMakeCache.txt
19+
CMakeFiles/
20+
cmake_install.cmake
21+
install_manifest.txt
22+
Makefile
23+
# CMake User Presets (lokale Pfade, nicht ins Repo!)
24+
CMakeUserPresets.json
25+
26+
# --- Clang / LLVM / Tooling ---
27+
# Wichtig für LSP Server (clangd), oft als Symlink im Root
28+
compile_commands.json
29+
# Clangd Cache
30+
.cache/
31+
.clangd/
32+
33+
# --- Testing & Coverage (Passend zu deinem Makefile) ---
34+
# Deine LCOV und LLVM Profile Daten
35+
*.profraw
36+
*.profdata
37+
*.lcov
38+
*.info
39+
# Coverage HTML Reports (falls du genhtml ausführst)
40+
/coverage_report/
41+
# Test-Ergebnisse (JUnit xml etc.)
42+
*.xml
43+
*.gcov
44+
45+
# --- Dependencies ---
46+
# CMake FetchContent Download-Ordner (wichtig für Snyk Scan)
47+
/_deps/
48+
# Externe Libs, falls manuell abgelegt (Pitchfork Layout)
49+
/external/
50+
51+
# --- IDEs & Editoren ---
52+
# VS Code (User Settings gehören nicht ins Repo)
53+
.vscode/
54+
# IntelliJ / CLion
55+
.idea/
56+
# Vim / Neovim Swap Files
57+
*.swp
58+
*.swo
59+
*.swn
60+
61+
# --- Documentation ---
62+
# Doxygen Output
63+
/docs/html/
64+
/docs/latex/
65+
/docs/xml/
66+
/doxygen.log
67+
68+
# --- OS Specifics ---
69+
# Linux
70+
.directory
71+
*~
72+
# Mac (Falls ein Kollege Macs nutzt)
73+
.DS_Store
74+
# Windows (Falls ein Kollege Windows nutzt)
75+
Thumbs.db

0 commit comments

Comments
 (0)