Skip to content

Prepare clang-tidy for 19 #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Checks: >
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-readability-math-missing-parentheses,
-readability-named-parameter,
-readability-static-definition-in-anonymous-namespace,
-readability-uppercase-literal-suffix,
Expand All @@ -30,12 +31,14 @@ Checks: >
-bugprone-narrowing-conversions,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
-modernize-make-unique,
-modernize-use-auto,
-modernize-use-designated-initializers,
-modernize-use-nodiscard,
-modernize-use-std-format,
-modernize-use-std-print,
-modernize-use-trailing-return-type,
-modernize-concat-nested-namespaces,
misc-*,
-misc-no-recursion,
-misc-unused-parameters,
Expand Down
23 changes: 13 additions & 10 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
{ pkgs ? import <nixpkgs> {} }:
let
bazel = pkgs.bazel_7;
clangTools = pkgs.clang-tools_18;

# There is too much volatility between even micro-versions of
# newer clang-format. Use slightly older version for now.
clang_for_formatting = pkgs.llvmPackages_18.clang-tools;

# clang tidy: use latest.
clang_for_tidy = pkgs.llvmPackages_18.clang-tools;
in
pkgs.mkShell {
name = "prjxtream";
name = "fpga-assembler";
packages = with pkgs; [
git
bazel
jdk
bash
bant
gdb

# For clang-tidy and clang-format.
clangTools
clang_for_formatting
clang_for_tidy

# For buildifier, buildozer.
bazel-buildtools
bant

# Profiling and sanitizers.
linuxPackages_latest.perf
Expand All @@ -26,10 +33,6 @@ pkgs.mkShell {
valgrind
];

# Expose as env variables the path to clang tools.
CLANG_TIDY = "${clangTools}/bin/clang-tidy";
CLANG_FORMAT = "${clangTools}/bin/clang-format";

# Override .bazelversion. We only care to have bazel 7.
USE_BAZEL_VERSION = "${bazel.version}";
CLANG_TIDY="${clang_for_tidy}/bin/clang-tidy";
CLANG_FORMAT="${clang_for_formatting}/bin/clang-format";
}