mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
Make it only bugprone check
This commit is contained in:
parent
a0527da40e
commit
1552fb6228
3 changed files with 18 additions and 3 deletions
|
@ -1,6 +1,5 @@
|
|||
# We use pointers to aggregates in a couple of places, intentionally.
|
||||
# void * would look weird.
|
||||
Checks: '
|
||||
misc-include-cleaner,
|
||||
-bugprone-sizeof-expression
|
||||
'
|
|
@ -291,6 +291,16 @@ To refresh pre-commit hook's config file, do the following:
|
|||
1. Exit the development shell and start it again by running `nix develop`.
|
||||
2. If you also use the pre-commit hook, also run `pre-commit-hooks-install` again.
|
||||
|
||||
#### Hooks
|
||||
|
||||
##### clang-tidy
|
||||
|
||||
Portions of the codebase are checked with [clang-tidy](https://clang.llvm.org/extra/clang-tidy/).
|
||||
|
||||
> clang-tidy is a clang-based C++ “linter” tool.
|
||||
|
||||
The current build system, Meson, by default outputs a `compile_commands.json` file which is used by all Clang tooling (clang-tidy, clangd etc..).
|
||||
|
||||
### VSCode
|
||||
|
||||
Insert the following json into your `.vscode/settings.json` file to configure `nixfmt`.
|
||||
|
|
|
@ -70,8 +70,14 @@
|
|||
# TODO: this requires meson to have been configured
|
||||
# we could optionally wrap this in a script that runs meson first
|
||||
# but for now let us keep it simple
|
||||
entry = "${pkgs.clang-tools}/bin/clang-tidy --fix -p ./build";
|
||||
files = ''^src/libstore'';
|
||||
#
|
||||
# clang-tidy doesn't work well running it on multiple files
|
||||
# TODO: change this to use run-clang-tidy.py
|
||||
entry = "${pkgs.writeShellScript "clang-tidy-wrapper" ''
|
||||
for file in "$@"; do
|
||||
"${pkgs.clang-tools}/bin/clang-tidy" --fix -p ./build "$file"
|
||||
done
|
||||
''}";
|
||||
};
|
||||
clang-format = {
|
||||
enable = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue