diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 22:00:45 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 22:07:30 +0100 |
| commit | 4e2112e165fdd94dee58378e3ea32892f3710cd7 (patch) | |
| tree | 4abfa63c9fec2ebb1ad3409d0476f733b51a324a | |
| parent | b5cd18739a64c8d923a55b61c89ae3900faafd84 (diff) | |
Make better diagnostics for clangd
| -rw-r--r-- | .clang-tidy | 13 | ||||
| -rw-r--r-- | .clangd | 15 | ||||
| -rw-r--r-- | makefile | 12 |
3 files changed, 27 insertions, 13 deletions
diff --git a/.clang-tidy b/.clang-tidy index a06e38d7..40ceb20b 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,12 +1,17 @@ --- -Checks: "clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling" +Checks: > + clang-analyzer-*, + bugprone-*, + llvm-*, + performance-*, + concurrency-*, + -bugprone-reserved-identifier, + -llvm-header-guard + WarningsAsErrors: "" HeaderFileExtensions: - h ImplementationFileExtensions: - c SystemHeaders: false -CheckOptions: - - key: clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling - value: "0" ... diff --git a/.clangd b/.clangd new file mode 100644 index 00000000..551d2c03 --- /dev/null +++ b/.clangd @@ -0,0 +1,15 @@ +CompileFlags: + Add: [-xc] + +Diagnostics: + ClangTidy: + FastCheckFilter: Strict + Add: + - clang-analyzer-* + - bugprone-* + - llvm-* + - performance-* + - concurrency-* + Remove: + - bugprone-reserved-identifier + - llvm-header-guard @@ -144,7 +144,7 @@ defconfig: $(Q)$(MAKE) -f scripts/kconfig/makefile defconfig include-what-you-use: compile_commands.json - $(Q)iwyu_tool.py -p. -j$(nproc) -- -Xiwyu --update_comments -Xiwyu --transitive_includes_only -Xiwyu --no_internal_mappings | \ + $(Q)iwyu_tool.py -p. -j4 -- -Xiwyu --update_comments -Xiwyu --transitive_includes_only -Xiwyu --no_internal_mappings | \ fix_includes.py --comments \ --quoted_includes_first \ --nosafe_headers \ @@ -152,14 +152,8 @@ include-what-you-use: compile_commands.json --reorder clang-tidy: compile_commands.json - $(Q)run-clang-tidy.py \ - -p . \ - -fix \ - -fix-errors \ - -header-filter='.*' \ - -source-filter='.*\.(c|h)$$' \ - -exclude-header-filter='(scripts/|dtoa|linux|arch|bits)' \ - -j $(shell nproc) + $(Q)clang-tidy -header-filter=.* -p=. -fix -fix-errors $(shell find . -name '*.c' -o -name '*.h' | grep -v './scripts/\|dtoa\|linux\|arch\|bits') \ + --export-fixes=clang-tidy-fixes.yaml clang-format: $(Q)clang-format -i $(shell find . -name '*.c' -o -name '*.h' | grep -v './scripts/') |
