Nudge clang-format to a more common recent version. clang-format-17 is bit ancient by now.
diff --git a/.github/bin/run-format.sh b/.github/bin/run-format.sh index e6bedd6..3c1c724 100755 --- a/.github/bin/run-format.sh +++ b/.github/bin/run-format.sh
@@ -47,12 +47,6 @@ BUILDIFIER=${BUILDIFIER:-buildifier} -# Currently, we're using clang-format 17, as newer versions still have some -# volatility in minor version. -${CLANG_FORMAT} --version | grep "17\." || - ( echo "-- Need clang-format 17. Currently CLANG_FORMAT=$CLANG_FORMAT --"; - exit 1) - # Run on all files. find . -name "*.h" -o -name "*.cc" \
diff --git a/.github/workflows/verible-ci.yml b/.github/workflows/verible-ci.yml index cd57cd7..9fd81b1 100644 --- a/.github/workflows/verible-ci.yml +++ b/.github/workflows/verible-ci.yml
@@ -26,7 +26,7 @@ CheckFormatAndBuildClean: - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: - name: Checkout code @@ -36,13 +36,15 @@ - name: Install Dependencies run: | + sudo apt-get install clang-format-19 + clang-format-19 --version go install github.com/bazelbuild/buildtools/buildifier@latest echo "PATH=$PATH:$(go env GOPATH)/bin/" >> $GITHUB_ENV - name: Run formatting style check run: | echo "--- check formatting ---" - CLANG_FORMAT=clang-format-17 ./.github/bin/run-format.sh --show-diff + CLANG_FORMAT=clang-format-19 ./.github/bin/run-format.sh --show-diff echo "--- check build dependencies ---" ./.github/bin/run-build-cleaner.sh echo "--- check potential problems ---"
diff --git a/shell.nix b/shell.nix index 7a8f55e..b616b4f 100644 --- a/shell.nix +++ b/shell.nix
@@ -37,14 +37,14 @@ lcov # coverage html generation. bazel-buildtools # buildifier - llvmPackages_21.clang-tools # for clang-tidy - llvmPackages_18.clang-tools # for clang-format + llvmPackages_22.clang-tools # for clang-tidy + llvmPackages_19.clang-tools # for clang-format ]; shellHook = '' # clang tidy: use latest. - export CLANG_TIDY=${pkgs.llvmPackages_21.clang-tools}/bin/clang-tidy + export CLANG_TIDY=${pkgs.llvmPackages_22.clang-tools}/bin/clang-tidy # Last version that current github CI supports. - export CLANG_FORMAT=${pkgs.llvmPackages_18.clang-tools}/bin/clang-format + export CLANG_FORMAT=${pkgs.llvmPackages_19.clang-tools}/bin/clang-format ''; }
diff --git a/verible/common/formatting/align.cc b/verible/common/formatting/align.cc index 9986fc7..74bc432 100644 --- a/verible/common/formatting/align.cc +++ b/verible/common/formatting/align.cc
@@ -1373,7 +1373,7 @@ break; } } // switch - } // for + } // for // Flush out the last range. if (match_count >= min_match_count) { result.emplace_back(last_range_start, partitions.end(), last_match_subtype);
diff --git a/verible/common/formatting/align_test.cc b/verible/common/formatting/align_test.cc index d667697..b9bdb47 100644 --- a/verible/common/formatting/align_test.cc +++ b/verible/common/formatting/align_test.cc
@@ -740,11 +740,12 @@ partition_.Children().end()); const std::vector<TaggedTokenPartitionRange> ranges( - GetPartitionAlignmentSubranges(children, [](const TokenPartitionTree - &partition) { - // Don't care about the subtype tag. - return AlignedPartitionClassification{PartitionSelector(partition), 0}; - })); + GetPartitionAlignmentSubranges(children, + [](const TokenPartitionTree &partition) { + // Don't care about the subtype tag. + return AlignedPartitionClassification{ + PartitionSelector(partition), 0}; + })); using P = std::pair<int, int>; std::vector<P> range_indices;
diff --git a/verible/common/text/parser-verifier.h b/verible/common/text/parser-verifier.h index 08edcb9..90aa0bc 100644 --- a/verible/common/text/parser-verifier.h +++ b/verible/common/text/parser-verifier.h
@@ -58,7 +58,7 @@ // TODO(jeremycs): changed these to protected and make SyntaxTreeLeaf // and SyntaxTreeNode friend classes void Visit(const SyntaxTreeLeaf &leaf) final; - void Visit(const SyntaxTreeNode &node) final{}; + void Visit(const SyntaxTreeNode &node) final {}; private: const Symbol &root_;
diff --git a/verible/verilog/analysis/checkers/forbid-consecutive-null-statements-rule_test.cc b/verible/verilog/analysis/checkers/forbid-consecutive-null-statements-rule_test.cc index 83914c6..eb483eb 100644 --- a/verible/verilog/analysis/checkers/forbid-consecutive-null-statements-rule_test.cc +++ b/verible/verilog/analysis/checkers/forbid-consecutive-null-statements-rule_test.cc
@@ -226,12 +226,12 @@ TEST(ForbidConsecutiveNullStatementsRuleTest, ApplyAutoFix) { const std::initializer_list<verible::AutoFixInOut> kTestCases = { - {"module m;\ninitial begin ;; end\nendmodule", - "module m;\ninitial begin ; end\nendmodule"}, - {"module m;\ninitial begin ; ; end\nendmodule", - "module m;\ninitial begin ; end\nendmodule"}, - {"module m;\ninitial begin ; /* */; end\nendmodule", - "module m;\ninitial begin ; /* */ end\nendmodule"}, + {"module m;\ninitial begin ;; end\nendmodule", + "module m;\ninitial begin ; end\nendmodule"}, + {"module m;\ninitial begin ; ; end\nendmodule", + "module m;\ninitial begin ; end\nendmodule"}, + {"module m;\ninitial begin ; /* */; end\nendmodule", + "module m;\ninitial begin ; /* */ end\nendmodule"}, #if 0 // TODO: apply multi-violation fixes in linter_test_utils. { "module m;\ninitial begin; ; ; ; end\nendmodule",
diff --git a/verible/verilog/analysis/flow-tree.h b/verible/verilog/analysis/flow-tree.h index d099bae..33bafa0 100644 --- a/verible/verilog/analysis/flow-tree.h +++ b/verible/verilog/analysis/flow-tree.h
@@ -77,7 +77,7 @@ using VariantReceiver = std::function<bool(const Variant &variant)>; explicit FlowTree(verible::TokenSequence source_sequence) - : source_sequence_(std::move(source_sequence)){}; + : source_sequence_(std::move(source_sequence)) {}; // Generates all possible variants. absl::Status GenerateVariants(const VariantReceiver &receiver);
diff --git a/verible/verilog/analysis/verilog-filelist.h b/verible/verilog/analysis/verilog-filelist.h index 0bb474a..915eb52 100644 --- a/verible/verilog/analysis/verilog-filelist.h +++ b/verible/verilog/analysis/verilog-filelist.h
@@ -27,7 +27,7 @@ // TODO(karimtera): Using "MacroDefiniton" struct might be better. struct TextMacroDefinition { TextMacroDefinition(std::string name, std::string value) - : name(std::move(name)), value(std::move(value)){}; + : name(std::move(name)), value(std::move(value)) {}; std::string name; std::string value;
diff --git a/verible/verilog/preprocessor/verilog-preprocess.h b/verible/verilog/preprocessor/verilog-preprocess.h index 568ed5e..2d134ae 100644 --- a/verible/verilog/preprocessor/verilog-preprocess.h +++ b/verible/verilog/preprocessor/verilog-preprocess.h
@@ -124,7 +124,7 @@ // Initialize preprocessing with safe default options // TODO(hzeller): remove this constructor once all places using the // preprocessor have been updated to pass a config. - VerilogPreprocess() : VerilogPreprocess(Config()){}; + VerilogPreprocess() : VerilogPreprocess(Config()) {}; // ScanStream reads in a stream of tokens returns the result as a move // of preprocessor_data_. preprocessor_data_ should not be accessed
diff --git a/verible/verilog/tools/kythe/kythe-facts.cc b/verible/verilog/tools/kythe/kythe-facts.cc index 3880d91..948a54e 100644 --- a/verible/verilog/tools/kythe/kythe-facts.cc +++ b/verible/verilog/tools/kythe/kythe-facts.cc
@@ -154,12 +154,16 @@ stream << idt << "\"source\": "; source_node.FormatJSON(stream, debug, indent_more) << "," << separator; } - { stream << idt << "\"edge_kind\": \"" << edge_name << "\"," << separator; } + { + stream << idt << "\"edge_kind\": \"" << edge_name << "\"," << separator; + } { stream << idt << "\"target\": "; target_node.FormatJSON(stream, debug, indent_more) << "," << separator; } - { stream << idt << "\"fact_name\": \"/\"" << separator; } + { + stream << idt << "\"fact_name\": \"/\"" << separator; + } return stream << verible::Spacer(indentation) << "}"; }