Skip to content

Commit

Permalink
Show diff from clang-format. (#1373)
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec authored May 3, 2024
1 parent 9e41b6d commit f55ef83
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ jobs:
run: |
brew update
brew install clang-format@18
git ls-files "*.cpp" "*.hpp" | xargs clang-format -style=file --dry-run --Werror
git ls-files "*.cpp" "*.hpp" | xargs clang-format -style=file -i
git diff --exit-code
build_test_tket:
name: Build and test (tket)
Expand Down
4 changes: 2 additions & 2 deletions libs/tklog/src/TketLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ void Logger::log(const char *levstr, const std::string &s, std::ostream &os) {
#else
plt = std::localtime(&t);
#endif
os << "[" << std::put_time(plt, "%Y-%m-%d %H:%M:%S") << "]" << " [tket] ["
<< levstr << "] " << s << std::endl;
os << "[" << std::put_time(plt, "%Y-%m-%d %H:%M:%S") << "]"
<< " [tket] [" << levstr << "] " << s << std::endl;
}

void Logger::set_level(LogLevel lev) { level = lev; }
Expand Down
2 changes: 1 addition & 1 deletion pytket/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def package(self):
cmake.install()

def requirements(self):
self.requires("tket/1.2.119@tket/stable")
self.requires("tket/1.2.120@tket/stable")
self.requires("tklog/0.3.3@tket/stable")
self.requires("tkrng/0.3.3@tket/stable")
self.requires("tkassert/0.3.4@tket/stable")
Expand Down
2 changes: 1 addition & 1 deletion tket/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class TketConan(ConanFile):
name = "tket"
version = "1.2.119"
version = "1.2.120"
package_type = "library"
license = "Apache 2"
homepage = "https://github.com/CQCL/tket"
Expand Down
4 changes: 2 additions & 2 deletions tket/src/Architecture/DistancesFromArchitecture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ std::size_t DistancesFromArchitecture::operator()(
distance_entry > 0 ||
AssertMessage() << "DistancesFromArchitecture: architecture has "
<< arch.n_nodes() << " vertices, "
<< arch.n_connections() << " edges; " << " and d("
<< vertex1 << "," << vertex2
<< arch.n_connections() << " edges; "
<< " and d(" << vertex1 << "," << vertex2
<< ")=0. "
"Is the graph connected?");
// GCOVR_EXCL_STOP
Expand Down
8 changes: 4 additions & 4 deletions tket/src/Clifford/UnitaryTableau.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,16 +715,16 @@ std::ostream& operator<<(std::ostream& os, const UnitaryRevTableau& tab) {
for (unsigned i = 0; i < nqs; ++i) {
Qubit qi = tab.tab_.qubits_.right.at(i);
os << tab.tab_.tab_.xmat.row(i) << " " << tab.tab_.tab_.zmat.row(i)
<< " " << tab.tab_.tab_.phase(i) << "\t->\t" << "X@" << qi.repr()
<< std::endl;
<< " " << tab.tab_.tab_.phase(i) << "\t->\t"
<< "X@" << qi.repr() << std::endl;
}
os << "--" << std::endl;
for (unsigned i = 0; i < nqs; ++i) {
Qubit qi = tab.tab_.qubits_.right.at(i);
os << tab.tab_.tab_.xmat.row(i + nqs) << " "
<< tab.tab_.tab_.zmat.row(i + nqs) << " "
<< tab.tab_.tab_.phase(i + nqs) << "\t->\t" << "Z@" << qi.repr()
<< std::endl;
<< tab.tab_.tab_.phase(i + nqs) << "\t->\t"
<< "Z@" << qi.repr() << std::endl;
}
return os;
}
Expand Down
3 changes: 1 addition & 2 deletions tket/src/Predicates/Predicates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ static std::string auto_name(const T&) {
return predicate_name(typeid(T));
}

#define SET_PRED_NAME(a) \
{ typeid(a), #a }
#define SET_PRED_NAME(a) {typeid(a), #a}

const std::string& predicate_name(std::type_index idx) {
static const std::map<std::type_index, std::string> predicate_names = {
Expand Down

0 comments on commit f55ef83

Please sign in to comment.