From 85412439125f9f03b243dd332fec7a7333ce559e Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Fri, 24 Nov 2023 15:32:14 +0100 Subject: [PATCH] cleanup --- .clang-format | 8 ++++ .clang-tidy | 30 +++++++++++++++ .clangd | 3 ++ compile_commands.json | 86 ------------------------------------------- 4 files changed, 41 insertions(+), 86 deletions(-) create mode 100644 .clang-format create mode 100644 .clang-tidy create mode 100644 .clangd delete mode 100644 compile_commands.json diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..299675f --- /dev/null +++ b/.clang-format @@ -0,0 +1,8 @@ +BasedOnStyle: Google +IndentWidth: 4 +InsertBraces: true +ColumnLimit: 79 +AlignConsecutiveMacros: Consecutive +AllowShortFunctionsOnASingleLine: None +AllowShortLoopsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: Never diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..17ce268 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,30 @@ +Checks: | + -*, + abseil-*, + bugprone-*, + clang-analyzer-*, + misc-*, + modernize-*, + performance-*, + portability-*, + readability-*, + llvm-*, + -bugprone-easily-swappable-parameters, + -readability-avoid-const-params-in-decls, + -readability-identifier-length + +CheckOptions: + - key: readability-inconsistent-declaration-parameter-name.Strict + value: true + - key: readability-identifier-naming.StructCase + value: lower_case + - key: readability-identifier-naming.FunctionCase + value: lower_case + - key: readability-identifier-naming.VariableCase + value: lower_case + - key: readability-identifier-naming.EnumConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.MacroDefinitionCase + value: UPPER_CASE + - key: readability-function-cognitive-complexity.Threshold + value: 15 diff --git a/.clangd b/.clangd new file mode 100644 index 0000000..f8cd025 --- /dev/null +++ b/.clangd @@ -0,0 +1,3 @@ +Diagnostics: + UnusedIncludes: Strict + MissingIncludes: Strict diff --git a/compile_commands.json b/compile_commands.json deleted file mode 100644 index a66985d..0000000 --- a/compile_commands.json +++ /dev/null @@ -1,86 +0,0 @@ -[ - { - "arguments": [ - "/usr/bin/cc", - "-c", - "-std=c99", - "-pedantic", - "-Wall", - "-Os", - "-I/usr/X11R6/include", - "-I/usr/include/freetype2", - "-D_DEFAULT_SOURCE", - "-D_BSD_SOURCE", - "-D_XOPEN_SOURCE=700", - "-D_POSIX_C_SOURCE=200809L", - "-DVERSION=\"5.2\"", - "-DXINERAMA", - "dmenu.c" - ], - "directory": "/home/luca/.local/src/dmenu", - "file": "/home/luca/.local/src/dmenu/dmenu.c" - }, - { - "arguments": [ - "/usr/bin/cc", - "-c", - "-std=c99", - "-pedantic", - "-Wall", - "-Os", - "-I/usr/X11R6/include", - "-I/usr/include/freetype2", - "-D_DEFAULT_SOURCE", - "-D_BSD_SOURCE", - "-D_XOPEN_SOURCE=700", - "-D_POSIX_C_SOURCE=200809L", - "-DVERSION=\"5.2\"", - "-DXINERAMA", - "drw.c" - ], - "directory": "/home/luca/.local/src/dmenu", - "file": "/home/luca/.local/src/dmenu/drw.c" - }, - { - "arguments": [ - "/usr/bin/cc", - "-c", - "-std=c99", - "-pedantic", - "-Wall", - "-Os", - "-I/usr/X11R6/include", - "-I/usr/include/freetype2", - "-D_DEFAULT_SOURCE", - "-D_BSD_SOURCE", - "-D_XOPEN_SOURCE=700", - "-D_POSIX_C_SOURCE=200809L", - "-DVERSION=\"5.2\"", - "-DXINERAMA", - "util.c" - ], - "directory": "/home/luca/.local/src/dmenu", - "file": "/home/luca/.local/src/dmenu/util.c" - }, - { - "arguments": [ - "/usr/bin/cc", - "-c", - "-std=c99", - "-pedantic", - "-Wall", - "-Os", - "-I/usr/X11R6/include", - "-I/usr/include/freetype2", - "-D_DEFAULT_SOURCE", - "-D_BSD_SOURCE", - "-D_XOPEN_SOURCE=700", - "-D_POSIX_C_SOURCE=200809L", - "-DVERSION=\"5.2\"", - "-DXINERAMA", - "stest.c" - ], - "directory": "/home/luca/.local/src/dmenu", - "file": "/home/luca/.local/src/dmenu/stest.c" - } -]