Skip to content

Enable bugprone easily swappable parameters #1871

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e05567c
Enable clang-tidy at target level
bavulapati Jul 17, 2025
8dfb57d
enable clang-tidy on all sourcemeta direct targets
bavulapati Jul 17, 2025
42c2e97
add target name to the log message
bavulapati Jul 17, 2025
7344164
enable clang-tidy from sourcemeta_library() definition
bavulapati Jul 18, 2025
de51204
Misc minor improvements
jviotti Jul 18, 2025
2a03d41
Use json file format
bavulapati Jul 21, 2025
333c824
remove performance-*
bavulapati Jul 21, 2025
773e2f5
remove irrelevant changes
bavulapati Jul 21, 2025
fe14e7d
remove .config file
bavulapati Jul 21, 2025
3acd087
add performance-* back
bavulapati Jul 21, 2025
b670976
Merge branch 'main' into clang-tidy-target-level
bavulapati Jul 22, 2025
bf7e78c
Merge branch 'rename-config-files-as-json-files' into alternate-main
bavulapati Jul 22, 2025
13e9896
Enable bugprone-* clang-tidy checks
bavulapati Jul 22, 2025
549f7c0
fix a bug reported on CI
bavulapati Jul 22, 2025
a8f491e
fix a warning reported on CI
bavulapati Jul 22, 2025
450e11b
disable optional_acess for now
bavulapati Jul 22, 2025
cb48e8c
Squash merge rename-config-files-as-json-files into enable-bugprone-c…
bavulapati Jul 22, 2025
93c82c1
Merge branch 'enable-bugprone-clang-tidy-checks' into alternate-main
bavulapati Jul 22, 2025
6aeaf79
Enable bugprone-easily-swappable-parameters
bavulapati Jul 22, 2025
7b70275
Merge branch 'main' into enable-bugprone-clang-tidy-checks
bavulapati Jul 23, 2025
a8b59a6
Merge branch 'enable-bugprone-clang-tidy-checks' into enable-bugprone…
bavulapati Jul 22, 2025
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
2 changes: 1 addition & 1 deletion cmake/common/clang-tidy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Checks": "-*, bugprone-*, -bugprone-easily-swappable-parameters,-bugprone-unchecked-optional-access, concurrency-*, modernize-*, performance-*, portability-*",
"Checks": "-*, bugprone-*, -bugprone-unchecked-optional-access, concurrency-*, modernize-*, performance-*, portability-*",
"WarningsAsErrors": "*",
"FormatStyle": "none",
"UseColor": true
Expand Down
2 changes: 2 additions & 0 deletions src/core/json/include/sourcemeta/core/json_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ namespace sourcemeta::core {
class SOURCEMETA_CORE_JSON_EXPORT JSONParseError : public std::exception {
public:
/// Create a parsing error
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
JSONParseError(const std::uint64_t line, const std::uint64_t column)
: line_{line}, column_{column} {}

/// Create a parsing error with a custom error
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
JSONParseError(const std::uint64_t line, const std::uint64_t column,
std::string message)
: line_{line}, column_{column}, message_{std::move(message)} {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ template <typename PropertyT, typename Hash> class GenericPointer {
/// sourcemeta::core::Pointer{"qux", "baz"});
/// ```
[[nodiscard]] auto
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
rebase(const GenericPointer<PropertyT, Hash> &prefix,
const GenericPointer<PropertyT, Hash> &replacement) const
-> GenericPointer<PropertyT, Hash> {
Expand Down
12 changes: 7 additions & 5 deletions src/core/jsonschema/frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,13 @@ auto SchemaFrame::to_json() const -> JSON {
return root;
}

auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker,
const SchemaResolver &resolver,
const std::optional<JSON::String> &default_dialect,
const std::optional<JSON::String> &default_id,
const SchemaFrame::Paths &paths) -> void {
auto SchemaFrame::analyse(
const JSON &root, const SchemaWalker &walker,
const SchemaResolver &resolver,
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
const std::optional<JSON::String> &default_dialect,
const std::optional<JSON::String> &default_id,
const SchemaFrame::Paths &paths) -> void {
std::vector<InternalEntry> subschema_entries;
std::map<Pointer, CacheSubschema> subschemas;
std::map<sourcemeta::core::Pointer, std::vector<JSON::String>> base_uris;
Expand Down
1 change: 1 addition & 0 deletions src/core/jsonschema/jsonschema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ static auto id_keyword(const std::string &base_dialect) -> std::string {
auto sourcemeta::core::identify(
const sourcemeta::core::JSON &schema, const SchemaResolver &resolver,
const SchemaIdentificationStrategy strategy,
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
const std::optional<std::string> &default_dialect,
const std::optional<std::string> &default_id)
-> std::optional<std::string> {
Expand Down
1 change: 1 addition & 0 deletions src/core/jsonschema/walker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ auto walk(const std::optional<sourcemeta::core::Pointer> &parent,
const sourcemeta::core::JSON &subschema,
const sourcemeta::core::SchemaWalker &walker,
const sourcemeta::core::SchemaResolver &resolver,
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
const std::string &dialect, const std::string &base_dialect,
const SchemaWalkerType_t type, const std::size_t level,
const bool orphan) -> void {
Expand Down
1 change: 1 addition & 0 deletions src/core/regex/include/sourcemeta/core/regex.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ auto matches(const Regex<T> &regex, const T &value) -> bool {
/// assert(sourcemeta::core::matches_if_valid("^foo", "foo bar"));
/// ```
template <typename T>
// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
auto matches_if_valid(const T &pattern, const T &value) -> bool {
const auto regex{to_regex(pattern)};
return regex.has_value() && matches(regex.value(), value);
Expand Down
1 change: 1 addition & 0 deletions src/core/uri/uri.cc
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ auto URI::relative_to(const URI &base) -> URI & {
return *this;
}

// NOLINTNEXTLINE(bugprone-easily-swappable-parameters)
auto URI::rebase(const URI &base, const URI &new_base) -> URI & {
this->relative_to(base);
if (!this->is_relative()) {
Expand Down
Loading