From dba3dd424d9ee431c1bb594844f6ffd88548be82 Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Sat, 6 Sep 2025 01:34:46 +0200 Subject: [PATCH] feat: add language specific project configs --- c/.clang-format | 25 +++++++++++++++++ c/.clang-tidy | 36 +++++++++++++++++++++++++ c/.clangd | 23 ++++++++++++++++ stylua.toml => lua/stylua.toml | 0 pyproject.toml => python/pyproject.toml | 6 ++++- 5 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 c/.clang-format create mode 100644 c/.clang-tidy create mode 100644 c/.clangd rename stylua.toml => lua/stylua.toml (100%) rename pyproject.toml => python/pyproject.toml (92%) diff --git a/c/.clang-format b/c/.clang-format new file mode 100644 index 0000000..7fa6cb4 --- /dev/null +++ b/c/.clang-format @@ -0,0 +1,25 @@ +--- +BasedOnStyle: LLVM +AlignAfterOpenBracket: BlockIndent +AlignArrayOfStructures: Left +AlignEscapedNewlines: Right +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: AllIfsAndElse +BinPackArguments: false +BinPackParameters: false +BreakBeforeBraces: WebKit +BreakConstructorInitializers: AfterColon +BreakInheritanceList: AfterColon +IncludeBlocks: Regroup +IncludeIsMainRegex: '(_test)?$' +IndentWidth: 4 +LineEnding: LF +PackConstructorInitializers: Never +PenaltyBreakAssignment: 100 +PointerAlignment: Left +QualifierAlignment: Right +Standard: Latest +WhitespaceSensitiveMacros: + - STRINGIZE + - STRINGIZE_VALUE +... diff --git a/c/.clang-tidy b/c/.clang-tidy new file mode 100644 index 0000000..f5435df --- /dev/null +++ b/c/.clang-tidy @@ -0,0 +1,36 @@ +--- +Checks: > + bugprone-*, + cert-*, + clang-analyzer-*, + clang-diagnostic-*, + concurrency-*, + cppcoreguidelines-*, + misc-*, + modernize-*, + performance-*, + portability-*, + readability-*, + -bugprone-easily-swappable-parameters, + -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, + -clang-analyzer-security.insecureAPI.strcpy, + -readability-braces-around-statements, + -readability-identifier-length, + -readability-implicit-bool-conversion, + -misc-no-recursion + +CheckOptions: + - key: readability-identifier-naming.VariableCase + value: lower_case + - key: readability-identifier-naming.FunctionCase + value: lower_case + - key: readability-identifier-naming.TypeCase + value: lower_case + - key: readability-identifier-naming.ConstantCase + value: UPPER_CASE + - key: readability-identifier-naming.MacroCase + value: UPPER_CASE + - key: readability-identifier-naming.EnumConstantCase + value: UPPER_CASE + +FormatStyle: file diff --git a/c/.clangd b/c/.clangd new file mode 100644 index 0000000..4d52ee1 --- /dev/null +++ b/c/.clangd @@ -0,0 +1,23 @@ +--- +Diagnostics: + UnusedIncludes: Strict + MissingIncludes: Strict + +CompileFlags: + Add: [-xc] + Remove: [-fanalyzer] + +Completion: + AllScopes: true + +InlayHints: + Enabled: No + +SemanticTokens: + DisabledKinds: [] + DisabledModifiers: [] + +# Will possibly be supported in clangd 22 +Documentation: + CommentFormat: Doxygen +... diff --git a/stylua.toml b/lua/stylua.toml similarity index 100% rename from stylua.toml rename to lua/stylua.toml diff --git a/pyproject.toml b/python/pyproject.toml similarity index 92% rename from pyproject.toml rename to python/pyproject.toml index 60a3053..0e574aa 100644 --- a/pyproject.toml +++ b/python/pyproject.toml @@ -69,7 +69,11 @@ ignore = [ "D301", "D413", "TC006", - "COM812" + "COM812", + "PLR0913", + "PLR0917", + "PYI011", + "UP031" ] [tool.pyrefly]