Skip to content

chore(lint): fix clang-tidy warnings and doc updates#166

Open
Typas wants to merge 10 commits into
DVLab-NTU:mainfrom
Typas:main
Open

chore(lint): fix clang-tidy warnings and doc updates#166
Typas wants to merge 10 commits into
DVLab-NTU:mainfrom
Typas:main

Conversation

@Typas

@Typas Typas commented Jul 1, 2026

Copy link
Copy Markdown

Check List

  1. Does your submission pass tests by running make test?
  2. If you have specified a [no ci] tag, does your submission also pass tests by running make test-docker?
  3. Have you linted your code locally with make lint before submission?

Added

  • None

Changed

  • README.md: expand Linux dependency installation from Ubuntu only to Ubuntu + Fedora. openSUSE has its own wiki page so I add the link. Other Linux distros have a reference link as well.

Fixed

Removed

  • None

Typas and others added 10 commits June 26, 2026 04:14
…htable

C-style casts in OTableIterator silently stripped const from the underlying
vector iterator, masking a const-correctness bug. Replaced with reinterpret_cast
and derived the `reference` type from VecIterType's value constness so no
qualifiers are stripped in either operator* overload.

Also adds non-const SubParsers::get_subparsers() overload exposed by the fix:
the old cast was allowing mutation through a const map iterator undetected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r APIs

cppcoreguidelines-pro-bounds-pointer-arithmetic flagged raw pointer
expressions. Replace &*rng.begin() with std::ranges::data(rng),
str.data() + str.size() with std::to_address(str.end()), and
str.data() + pos with std::next(str.data(), pos). Assembly-verified
identical codegen at -O3.

Co-Authored-By: Claude <noreply@anthropic.com>
cppcoreguidelines-pro-bounds-pointer-arithmetic fired on all fmt
formatter parse() methods that used *it++ and on two util sites.
Split *it++ into dereference + std::next(it) in formatter parse()
bodies (phase.hpp, pauli_rotation.hpp, stabilizer_tableau.hpp,
tableau.hpp). Replaced word.begin()+pos with word.substr(0,pos) in
trie.cpp, and raw[0] with *raw in boolean_matrix.cpp. All changes
are zero-cost at -O3 (verified via codegen inspection).

Co-Authored-By: Claude <noreply@anthropic.com>
std::filesystem::path passed directly to spdlog triggers FMT_STRING
consteval format validation which fails because path's formatter is
not constexpr-evaluable. Call .string() explicitly at each call site.

Co-Authored-By: Claude <noreply@anthropic.com>
clang-tidy readability-inconsistent-ifelse-braces flagged bare
single-statement else/else-if branches mixed with braced siblings.
Added braces for consistency throughout.

Co-Authored-By: Claude <noreply@anthropic.com>
clang-tidy performance-inefficient-vector-operation flagged repeated
emplace_back calls in loops without prior reservation. Adding reserve()
avoids incremental reallocations.

Co-Authored-By: Claude <noreply@anthropic.com>
clang-tidy performance-move-const-arg flagged std::move() calls whose
result was passed to push_back(const SubTableau&), making the move a
no-op. Adding a push_back(SubTableau&&) overload enables actual moves
at the call sites in adaptive_gadget.cpp.

Co-Authored-By: Claude <noreply@anthropic.com>
clang-tidy performance-unnecessary-value-param flagged parameters that
are copied on every call but only used as const. Changing to const
reference avoids the copy with no semantic change.

Co-Authored-By: Claude <noreply@anthropic.com>
- Add Fedora dependency installation instructions
- Add openSUSE dependency guideline link
- Add the OpenBLAS reference for the other distros
- Align markdown tables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant