Skip to content

Commit

Permalink
no-NOLINT (src/, include/) for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ban-nobuhiro committed Jan 16, 2025
1 parent 3f019d6 commit b8a8e30
Show file tree
Hide file tree
Showing 85 changed files with 485 additions and 485 deletions.
6 changes: 3 additions & 3 deletions include/shirakami/api_sequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ using SequenceVersion = std::size_t;
* @note This function is not intended to be called concurrently with running
* transactions. Typical usage is in DDL to register sequence objects.
*/
Status create_sequence(SequenceId* id); // NOLINT
Status create_sequence(SequenceId* id); // LINT

/**
* @brief update sequence value and version.
Expand Down Expand Up @@ -94,7 +94,7 @@ Status update_sequence(Token token, SequenceId id, SequenceVersion version,
* time of database recovery.
*/
Status read_sequence(SequenceId id, SequenceVersion* version,
SequenceValue* value); // NOLINT
SequenceValue* value); // LINT

/**
* @brief delete the sequence
Expand All @@ -107,6 +107,6 @@ Status read_sequence(SequenceId id, SequenceVersion* version,
* @note This function is not intended to be called concurrently with running
* transactions. Typical usage is in DDL to unregister sequence objects.
*/
Status delete_sequence(SequenceId id); // NOLINT
Status delete_sequence(SequenceId id); // LINT

} // namespace shirakami
2 changes: 1 addition & 1 deletion include/shirakami/api_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace shirakami {
* Please review your usage.
*/
Status create_storage(std::string_view key, Storage& storage,
storage_option const& options = {}); // NOLINT
storage_option const& options = {}); // LINT

/**
* @brief delete existing storage and records under the storage.
Expand Down
4 changes: 2 additions & 2 deletions include/shirakami/binary_printer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class binary_printer {
std::ios init(nullptr);
init.copyfmt(out);
for (std::size_t idx = 0; idx < value.size_; ++idx) {
auto c = *(static_cast<std::uint8_t const*>(value.ptr_) + // NOLINT
auto c = *(static_cast<std::uint8_t const*>(value.ptr_) + // LINT

Check warning on line 39 in include/shirakami/binary_printer.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-pro-bounds-pointer-arithmetic

do not use pointer arithmetic
idx);
if (std::isprint(c) != 0) {
out << c;
Expand All @@ -45,7 +45,7 @@ class binary_printer {
out << std::hex << std::setw(2) << std::setfill('0')
<< static_cast<std::uint32_t>(
*(static_cast<std::uint8_t const*>(
value.ptr_) + // NOLINT
value.ptr_) + // LINT

Check warning on line 48 in include/shirakami/binary_printer.h

View workflow job for this annotation

GitHub Actions / Clang-Tidy

cppcoreguidelines-pro-bounds-pointer-arithmetic

do not use pointer arithmetic
idx));
}
}
Expand Down
6 changes: 3 additions & 3 deletions include/shirakami/database_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class database_options final {
MAINTENANCE = 0x004,
};

database_options() = default; // NOLINT
database_options() = default; // LINT

database_options(open_mode om) : open_mode_(om) {} // NOLINT
database_options(open_mode om) : open_mode_(om) {} // LINT

database_options(open_mode om, std::filesystem::path&& log_directory_path)
: open_mode_(om), log_directory_path_(log_directory_path) {}
Expand Down Expand Up @@ -99,7 +99,7 @@ class database_options final {
/**
* @brief Parameter of epoch [us]
*/
std::size_t epoch_time_{40000}; // NOLINT
std::size_t epoch_time_{40000}; // LINT
// ==========

// ==========
Expand Down
32 changes: 16 additions & 16 deletions include/shirakami/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace shirakami {
* wait the result.
* @return Status::WARN_NOT_BEGIN This transaction was not begun.
*/
Status abort(Token token); // NOLINT
Status abort(Token token); // LINT

/**
* @brief close the scan which was opened at open_scan.
Expand All @@ -44,7 +44,7 @@ Status abort(Token token); // NOLINT
* @return Status::WARN_NOT_BEGIN The transaction was not begun. So it
* can't execute it.
*/
Status close_scan(Token token, ScanHandle handle); // NOLINT
Status close_scan(Token token, ScanHandle handle); // LINT

/**
* @brief commit function with result notified by callback
Expand Down Expand Up @@ -76,7 +76,7 @@ bool commit(Token token, commit_callback_type callback);
/**
* @brief old api. it is planed to remove from api.
*/
Status commit(Token token); // NOLINT
Status commit(Token token); // LINT

/**
* @brief delete the record for the given key
Expand Down Expand Up @@ -107,7 +107,7 @@ Status commit(Token token); // NOLINT
* @return Status::OK success.
* @return Status::ERR_READ_AREA_VIOLATION error about read area.
*/
Status delete_record(Token token, Storage storage, // NOLINT
Status delete_record(Token token, Storage storage, // LINT
std::string_view key);

/**
Expand All @@ -119,7 +119,7 @@ Status delete_record(Token token, Storage storage, // NOLINT
* @return Status::OK
* @return Status::ERR_SESSION_LIMIT There are no capacity of session.
*/
Status enter(Token& token); // NOLINT
Status enter(Token& token); // LINT

/**
* @brief Confirm existence of the key in the @a storage.
Expand Down Expand Up @@ -159,7 +159,7 @@ Status exist_key(Token token, Storage storage, std::string_view key);
* interface.
* @return void
*/
void fin(bool force_shut_down_logging = true); // NOLINT
void fin(bool force_shut_down_logging = true); // LINT

/**
* @brief It initializes shirakami's environment.
Expand All @@ -174,7 +174,7 @@ void fin(bool force_shut_down_logging = true); // NOLINT
* @return Status::WARN_ALREADY_INIT Since it have already called int, it have
* not done anything in this call.
*/
Status init(database_options options = {}); // NOLINT
Status init(database_options options = {}); // LINT

/**
* @brief insert the record with given key/value
Expand Down Expand Up @@ -205,7 +205,7 @@ Status init(database_options options = {}); // NOLINT
* @return Status::ERR_READ_AREA_VIOLATION error about read area.
*/
Status insert(Token token, Storage storage,
std::string_view key, // NOLINT
std::string_view key, // LINT
std::string_view val);

/**
Expand All @@ -217,7 +217,7 @@ Status insert(Token token, Storage storage,
* @return Status::WARN_NOT_IN_A_SESSION The session may be already ended.
* @return Status::ERR_INVALID_ARGS The @b token is invalid.
*/
Status leave(Token token); // NOLINT
Status leave(Token token); // LINT

/**
* @brief This function preserve the specified range of masstree. If you use ltx
Expand Down Expand Up @@ -258,8 +258,8 @@ Status leave(Token token); // NOLINT
Status open_scan(Token token, Storage storage, std::string_view l_key,
scan_endpoint l_end, std::string_view r_key,
scan_endpoint r_end, ScanHandle& handle,
std::size_t max_size = 0, // NOLINT
bool right_to_left = false); // NOLINT
std::size_t max_size = 0, // LINT
bool right_to_left = false); // LINT

/**
* @brief advance cursor
Expand Down Expand Up @@ -334,7 +334,7 @@ Status read_value_from_scan(Token token, ScanHandle handle, std::string& value);
*/
[[maybe_unused]] Status scannable_total_index_size(Token token,
ScanHandle handle,
std::size_t& size); // NOLINT
std::size_t& size); // LINT

/**
* @brief It searches with the given key and return the found tuple.
Expand Down Expand Up @@ -362,7 +362,7 @@ Status read_value_from_scan(Token token, ScanHandle handle, std::string& value);
* @return Status::ERR_READ_AREA_VIOLATION error about read area.
*/
Status search_key(Token token, Storage storage, std::string_view key,
std::string& value); // NOLINT
std::string& value); // LINT

/**
* @brief Transaction begins.
Expand All @@ -385,7 +385,7 @@ Status search_key(Token token, Storage storage, std::string_view key,
* write_preserve and not using long tx mode.
* @return Status::WARN_INVALID_ARGS User used storages not existed.
*/
Status tx_begin(transaction_options options = {}); // NOLINT
Status tx_begin(transaction_options options = {}); // LINT

/**
* @brief It updates the record for the given key.
Expand All @@ -405,7 +405,7 @@ Status tx_begin(transaction_options options = {}); // NOLINT
* @return Status::ERR_READ_AREA_VIOLATION error about read area.
*/
Status update(Token token, Storage storage, std::string_view key,
std::string_view val); // NOLINT
std::string_view val); // LINT

/**
* @brief update the record for the given key, or insert the key/value if the
Expand All @@ -429,7 +429,7 @@ Status update(Token token, Storage storage, std::string_view key,
* this tx is long tx and didn't execute wp for @a storage.
*/
Status upsert(Token token, Storage storage, std::string_view key,
std::string_view val); // NOLINT
std::string_view val); // LINT


//==========
Expand Down
12 changes: 6 additions & 6 deletions include/shirakami/log_record.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,35 +93,35 @@ struct log_record {
* @brief operation type for log record entry.
*
*/
log_operation operation_{}; // NOLINT
log_operation operation_{}; // LINT

/**
* @brief key part of the log record
*/
std::string_view key_{}; // NOLINT
std::string_view key_{}; // LINT

/**
* @brief value part of the log record
*
*/
std::string_view value_{}; // NOLINT
std::string_view value_{}; // LINT

/**
* @brief major version of the log record
*
*/
std::uint64_t major_version_{}; // NOLINT
std::uint64_t major_version_{}; // LINT

/**
* @brief minor version of the log record
*
*/
std::uint64_t minor_version_{}; // NOLINT
std::uint64_t minor_version_{}; // LINT

/**
* @brief storage id where the log record is made
*/
storage_id_type storage_id_{}; // NOLINT
storage_id_type storage_id_{}; // LINT
};

static_assert(std::is_trivially_copyable_v<log_record>);
Expand Down
2 changes: 1 addition & 1 deletion include/shirakami/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static constexpr std::string_view log_location_prefix_timing_event =
// receive string_view only
#define shirakami_binstring(arg) \
" " #arg "(len=" << (arg).size() << "):\"" << binary_printer((arg)) \
<< "\"" //NOLINT
<< "\"" //LINT

/**
* @brief logging level constant for errors
Expand Down
26 changes: 13 additions & 13 deletions include/shirakami/result_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,34 +75,34 @@ inline constexpr std::string_view to_string_view(reason_code rc) noexcept {
using namespace std::string_view_literals;
switch (rc) {
case reason_code::UNKNOWN:
return "UNKNOWN"sv; // NOLINT
return "UNKNOWN"sv; // LINT
case reason_code::KVS_DELETE:
return "KVS_DELETE"sv; // NOLINT
return "KVS_DELETE"sv; // LINT
case reason_code::KVS_INSERT:
return "KVS_INSERT"sv; // NOLINT
return "KVS_INSERT"sv; // LINT
case reason_code::KVS_UPDATE:
return "KVS_UPDATE"sv; // NOLINT
return "KVS_UPDATE"sv; // LINT
case reason_code::CC_LTX_PHANTOM_AVOIDANCE:
return "CC_LTX_PHANTOM_AVOIDANCE"sv; //NOLINT
return "CC_LTX_PHANTOM_AVOIDANCE"sv; //LINT
case reason_code::CC_LTX_READ_AREA_VIOLATION:
return "CC_LTX_READ_AREA_VIOLATION"sv; // NOLINT
return "CC_LTX_READ_AREA_VIOLATION"sv; // LINT
case reason_code::CC_LTX_READ_UPPER_BOUND_VIOLATION:
return "CC_LTX_READ_UPPER_BOUND_VIOLATION"sv; // NOLINT
return "CC_LTX_READ_UPPER_BOUND_VIOLATION"sv; // LINT
case reason_code::CC_LTX_WRITE_COMMITTED_READ_PROTECTION:
return "CC_LTX_WRITE_COMMITTED_READ_PROTECTION"sv; // NOLINT
return "CC_LTX_WRITE_COMMITTED_READ_PROTECTION"sv; // LINT
case reason_code::CC_OCC_READ_VERIFY:
return "CC_OCC_READ_VERIFY"sv; // NOLINT
return "CC_OCC_READ_VERIFY"sv; // LINT
case reason_code::CC_OCC_WP_VERIFY:
return "CC_OCC_WP_VERIFY"sv; // NOLINT
return "CC_OCC_WP_VERIFY"sv; // LINT
case reason_code::CC_OCC_PHANTOM_AVOIDANCE:
return "CC_OCC_PHANTOM_AVOIDANCE"sv; //NOLINT
return "CC_OCC_PHANTOM_AVOIDANCE"sv; //LINT
case reason_code::USER_ABORT:
return "USER_ABORT"sv; // NOLINT
return "USER_ABORT"sv; // LINT
}
std::abort();
}

inline std::ostream& operator<<(std::ostream& out, reason_code rc) { // NOLINT
inline std::ostream& operator<<(std::ostream& out, reason_code rc) { // LINT
return out << to_string_view(rc);
}

Expand Down
Loading

0 comments on commit b8a8e30

Please sign in to comment.