Add clion files to gitignore + Add clang-format

This commit is contained in:
Sam 'snaens' Pelz 2026-03-26 12:59:32 +01:00
parent ffdaf12535
commit 14b52adb7c
3 changed files with 74 additions and 4 deletions

57
.clang-format Normal file
View File

@ -0,0 +1,57 @@
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignOperands: true
AlignTrailingComments: false
AlwaysBreakTemplateDeclarations: Yes
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBraces: Custom
BreakConstructorInitializers: AfterColon
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 240
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ContinuationIndentWidth: 8
IncludeCategories:
- Regex: '^<.*'
Priority: 1
- Regex: '^".*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentWidth: 4
InsertNewlineAtEOF: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
TabWidth: 4
...

3
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.zip *.zip
*.exe *.exe
*.o *.o
.idea/

View File

@ -1,4 +1,16 @@
/************************************************************************************************* /*************************************************************************************************
* Schreiben Sie ein Programm, das das Gewicht in kg und die Groesse in cm einliest und dann den * * Schreiben Sie ein Programm, das das Gewicht in kg und die Groesse in cm
* Body Mass Index mit zwei Nachkommastellen ausgibt (bmi = gewicht / (groesse in m)²). * * einliest und dann den * Body Mass Index mit zwei Nachkommastellen ausgibt
*************************************************************************************************/ * (bmi = gewicht / (groesse in m)²). *
*************************************************************************************************/
#include <stdio.h>
int main() {
unsigned int gewicht_kg = 0;
unsigned int groesse_m = 0;
scanf("gewicht: %i\n", &gewicht_kg);
printf("gewicht: %i\n", gewicht_kg);
return 0;
}