Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
davemarco committed Nov 4, 2024
1 parent cd50c9a commit d2cf122
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/clp_ffi_js/ir/StreamReader.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "StreamReader.hpp"

#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <format>
Expand Down
7 changes: 3 additions & 4 deletions src/clp_ffi_js/ir/StreamReader.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#ifndef CLP_FFI_JS_IR_STREAM_READER_HPP
#define CLP_FFI_JS_IR_STREAM_READER_HPP

#include <array>
#include <cstddef>
#include <string>
#include <memory>
#include <string_view>

#include <emscripten/val.h>

Expand All @@ -13,9 +14,7 @@ EMSCRIPTEN_DECLARE_VAL_TYPE(DataArrayTsType);
EMSCRIPTEN_DECLARE_VAL_TYPE(DecodedResultsTsType);
EMSCRIPTEN_DECLARE_VAL_TYPE(FilteredLogEventMapTsType);

constexpr std::array<std::string_view, 4> cIrV1Versions = {
"v0.0.1", "v0.0.0", "0.0.1", "0.0.0"
};
constexpr std::array<std::string_view, 4> cIrV1Versions = {"v0.0.1", "v0.0.0", "0.0.1", "0.0.0"};

/**
* Class to deserialize and decode Zstandard-compressed CLP IR streams as well as format decoded
Expand Down
21 changes: 10 additions & 11 deletions src/clp_ffi_js/ir/decoding_methods.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "decoding_methods.hpp"

#include <cstdint>
#include <format>
#include <json/single_include/nlohmann/json.hpp>
#include <string>
#include <string_view>
Expand Down Expand Up @@ -53,15 +54,13 @@ auto get_version(clp::ReaderInterface& reader) -> std::string {
clp::ffi::ir_stream::deserialize_preamble(reader, metadata_type, metadata_bytes)
};
if (clp::ffi::ir_stream::IRErrorCode::IRErrorCode_Success != deserialize_preamble_result) {
SPDLOG_CRITICAL(
"Failed to deserialize preamble for version reading: {}",
deserialize_preamble_result
);
SPDLOG_CRITICAL("Failed to deserialize preamble for version reading");

throw ClpFfiJsException{
clp::ErrorCode::ErrorCode_Failure,
__FILENAME__,
__LINE__,
fmt::format("Failed to deserialize preamble version reading: {}", deserialize_preamble_result)
"Failed to deserialize preamble for version reading"
};
}

Expand All @@ -75,13 +74,13 @@ auto get_version(clp::ReaderInterface& reader) -> std::string {
try {
nlohmann::json const metadata = nlohmann::json::parse(metadata_view);
version = metadata.at(clp::ffi::ir_stream::cProtocol::Metadata::VersionKey);
} catch (const nlohmann::json::exception& e) {
} catch (nlohmann::json::exception const& e) {
throw ClpFfiJsException{
clp::ErrorCode::ErrorCode_MetadataCorrupted,
__FILENAME__,
__LINE__,
fmt::format("Error parsing stream metadata: {}", e.what())
};
clp::ErrorCode::ErrorCode_MetadataCorrupted,
__FILENAME__,
__LINE__,
std::format("Error parsing stream metadata: {}", e.what())
};
}

SPDLOG_INFO("The version is {}", version);
Expand Down
1 change: 1 addition & 0 deletions src/clp_ffi_js/ir/decoding_methods.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace clp_ffi_js::ir {
* @throws ClpFfiJsException if the encoding type couldn't be decoded or the encoding type is
* unsupported.
* @throws ClpFfiJsException if the preamble could not be deserialized.
* @return Stream version.
*/
auto get_version(clp::ReaderInterface& reader) -> std::string;
/**
Expand Down

0 comments on commit d2cf122

Please sign in to comment.