Skip to content

Commit

Permalink
Use clang-format 19. (#1587)
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec authored Sep 17, 2024
1 parent c6cd685 commit bddb694
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ jobs:
name: Check C++ code formatting
needs: check_changes
if: needs.check_changes.outputs.tket_or_workflow_changed == 'true'
runs-on: 'macos-12'
runs-on: 'macos-14'
steps:
- uses: actions/checkout@v4
- name: Check C++ code formatting
run: |
brew update
brew install clang-format@18
brew install clang-format@19
git ls-files "*.cpp" "*.hpp" | xargs clang-format -style=file -i
git diff --exit-code
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repo.
C++20 features may be used whenever they are supported by all the compilers
used on the CI (listed in the README).

All C++ code should be formatted with `clang-format` (v18) using the
All C++ code should be formatted with `clang-format` (v19) using the
configuration file `.clang-format` in the root directory. This is checked on
the CI. The script `do-clang-format` will run this over all C++ files in the
repository and fix them up.
Expand Down
12 changes: 6 additions & 6 deletions pytket/binders/pauli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ PYBIND11_MODULE(pauli, m) {
py::arg("other"))
.def(
"to_sparse_matrix",
(CmplxSpMat(SpPauliString::*)(void) const) &
SpPauliString::to_sparse_matrix,
(CmplxSpMat(SpPauliString::*)(void)
const)&SpPauliString::to_sparse_matrix,
"Represents the sparse string as a dense string (without "
"padding for extra qubits) and generates the matrix for the "
"tensor. Uses the ILO-BE convention, so ``Qubit(\"a\", 0)`` "
Expand All @@ -110,8 +110,8 @@ PYBIND11_MODULE(pauli, m) {
"\n\n:return: a sparse matrix corresponding to the operator")
.def(
"to_sparse_matrix",
(CmplxSpMat(SpPauliString::*)(const unsigned) const) &
SpPauliString::to_sparse_matrix,
(CmplxSpMat(SpPauliString::*)(const unsigned)
const)&SpPauliString::to_sparse_matrix,
"Represents the sparse string as a dense string over "
"`n_qubits` qubits (sequentially indexed from 0 in the "
"default register) and generates the matrix for the tensor. "
Expand All @@ -137,8 +137,8 @@ PYBIND11_MODULE(pauli, m) {
py::arg("qubits"))
.def(
"dot_state",
(Eigen::VectorXcd(SpPauliString::*)(const Eigen::VectorXcd &) const) &
SpPauliString::dot_state,
(Eigen::VectorXcd(SpPauliString::*)(const Eigen::VectorXcd &)
const)&SpPauliString::dot_state,
"Performs the dot product of the state with the pauli string. "
"Maps the qubits of the statevector with sequentially-indexed "
"qubits in the default register, with ``Qubit(0)`` being the "
Expand Down
2 changes: 1 addition & 1 deletion pytket/binders/zx/diagram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void ZXDiagramPybind::init_zxdiagram(py::module& m) {
py::arg("v"), py::arg("gen"))
.def(
"get_wire_qtype",
(QuantumType(ZXDiagram::*)(const Wire&) const) & ZXDiagram::get_qtype,
(QuantumType(ZXDiagram::*)(const Wire&) const)&ZXDiagram::get_qtype,
"Returns the :py:class:`QuantumType` of the given wire.",
py::arg("w"))
.def(
Expand Down

0 comments on commit bddb694

Please sign in to comment.