Skip to content

Commit

Permalink
Run clang-format
Browse files Browse the repository at this point in the history
Fix pre-commit workflow failures
  • Loading branch information
serge-s authored and pboettch committed Sep 2, 2024
1 parent 813eb63 commit fbd72de
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 200 deletions.
18 changes: 8 additions & 10 deletions src/json-validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,26 +429,25 @@ enum logical_combination_types {
class logical_combination_error_handler : public error_handler
{
public:
struct error_entry
{
struct error_entry {
json::json_pointer ptr_;
json instance_;
std::string message_;
};

std::vector<error_entry> error_entry_list_;

void error(const json::json_pointer &ptr, const json &instance, const std::string &message) override
{
error_entry_list_.push_back(error_entry{ ptr, instance, message });
error_entry_list_.push_back(error_entry{ptr, instance, message});
}

void propagate(error_handler& e, const std::string& prefix) const
void propagate(error_handler &e, const std::string &prefix) const
{
for (const error_entry& entry : error_entry_list_)
for (const error_entry &entry : error_entry_list_)
e.error(entry.ptr_, entry.instance_, prefix + entry.message_);
}

operator bool() const { return !error_entry_list_.empty(); }
};

Expand All @@ -463,7 +462,7 @@ class logical_combination : public schema
logical_combination_error_handler error_summary;

for (std::size_t index = 0; index < subschemata_.size(); ++index) {
const std::shared_ptr<schema>& s = subschemata_[index];
const std::shared_ptr<schema> &s = subschemata_[index];
logical_combination_error_handler esub;
auto oldPatchSize = patch.get_json().size();
s->validate(ptr, instance, patch, esub);
Expand Down Expand Up @@ -513,8 +512,7 @@ const std::string logical_combination<oneOf>::key = "oneOf";
template <>
bool logical_combination<allOf>::is_validate_complete(const json &, const json::json_pointer &, error_handler &e, const logical_combination_error_handler &esub, size_t, size_t current_schema_index)
{
if (esub)
{
if (esub) {
e.error(esub.error_entry_list_.front().ptr_, esub.error_entry_list_.front().instance_, "at least one subschema has failed, but all of them are required to validate - " + esub.error_entry_list_.front().message_);
esub.propagate(e, "[combination: allOf / case#" + std::to_string(current_schema_index) + "] ");
}
Expand Down
Loading

1 comment on commit fbd72de

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on your Packit configuration the settings of the lecris/nightly Copr project would need to be updated as follows:

field old value new value
additional_repos [] ['copr://@scikit-build/release']

Packit was unable to update the settings above as it is missing admin permissions on the lecris/nightly Copr project.

To fix this you can do one of the following:

  • Grant Packit admin permissions on the lecris/nightly Copr project on the permissions page.
  • Change the above Copr project settings manually on the settings page to match the Packit configuration.
  • Update the Packit configuration to match the Copr project settings.

Please retrigger the build, once the issue above is fixed.

Please sign in to comment.