From 8553ba0e14c2718d27d9b0c7e5de9a9583d30b45 Mon Sep 17 00:00:00 2001 From: Cory Date: Fri, 8 Dec 2023 09:26:07 +0100 Subject: [PATCH] Add formatting --- .clang-format | 46 ++++++++++++++++++++++++++++++++++++++++++++++ .clangd | 2 ++ 2 files changed, 48 insertions(+) create mode 100644 .clang-format create mode 100644 .clangd diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..afcda5d --- /dev/null +++ b/.clang-format @@ -0,0 +1,46 @@ +# Set the language to C++ +Language: Cpp + +# Set the language standard to C++11 +Standard: Cpp11 + +# Never use tab for indentation +UseTab: Never + +# Set the indent width to be 4 columns +IndentWidth: 4 + +# Set tab width to be 4 columns +TabWidth: 4 + +# Set access modifier (public, private, protected) offset to indent left +AccessModifierOffset: -4 + +# Stop indentation of access modifiers +IndentAccessModifiers: false + +# Don't allow a function to be defined on a single line +AllowShortFunctionsOnASingleLine: false + +# Set the column limit to 80 characters +ColumnLimit: 80 + +# If an expression has to be split, then split before binary operators unless +# it's an assignment operator. +BreakBeforeBinaryOperators: NonAssignment + +# Use a Linux style brace break. +# Break before braces on function, namespace and class definitions. +BreakBeforeBraces: Stroustrup + +# If true, spaces will be inserted after ( and before ). +SpacesInParentheses: false + +# If true, spaces will be inserted after [ and before ]. +SpacesInSquareBrackets: false + +# Separate definition blocks (classes, functions, structs, enums) +SeparateDefinitionBlocks: Always + +# Sort includes by type +IncludeBlocks: Regroup diff --git a/.clangd b/.clangd new file mode 100644 index 0000000..3c44a56 --- /dev/null +++ b/.clangd @@ -0,0 +1,2 @@ +CompileFlags: + Add: [-I../include]