Skip to content

clang-tidy warnings for bugprone-easily-swappable-parameters #1761

@bavulapati

Description

@bavulapati
/Users/balakrishna/source/core/src/core/jsonschema/walker.cc:17:11: error: 2 adjacent parameters of 'walk' of similar type ('const std::string &') are easily swapped by mistake [bugprone-easily-swappable-parameters,-warnings-as-errors]
   17 |           const std::string &dialect, const std::string &base_dialect,
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/balakrishna/source/core/src/core/jsonschema/walker.cc:17:30: note: the first parameter in the range is 'dialect'
   17 |           const std::string &dialect, const std::string &base_dialect,
      |                              ^~~~~~~
/Users/balakrishna/source/core/src/core/jsonschema/walker.cc:17:58: note: the last parameter in the range is 'base_dialect'
   17 |           const std::string &dialect, const std::string &base_dialect,
      |                                                          ^~~~~~~~~~~~
/Users/balakrishna/source/core/src/core/jsonschema/walker.cc:49:13: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]
   49 |           ? sourcemeta::core::base_dialect(subschema, resolver, current_dialect)

There are many more of these reports. This is just an example.
This might be helpful but tedious.
Open to thoughts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions