Skip to content

Commit 9172a2e

Browse files
authored
fix cpplint issues (onnx#7650)
### Motivation and Context Fixes # --------- Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
1 parent 6a77409 commit 9172a2e

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

.github/workflows/manylinux/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fi
6868
# find -exec does not preserve failed exit codes, so use an output file for failures
6969
failed_wheels=$PWD/failed-wheels
7070
rm -f "$failed_wheels"
71-
find . -type f -iname "*-linux*.whl" -exec sh -c "auditwheel repair '{}' -w \$(dirname '{}') --plat '${PLAT}' || { echo 'Repairing wheels failed.'; auditwheel show '{}' >> '$failed_wheels'; }" \;
71+
find . -type f -iname "*-linux*.whl" -exec sh -c 'auditwheel repair "$1" -w "$(dirname "$1")" --plat "$2" || { echo "Repairing wheels failed."; auditwheel show "$1" >> "$3"; }' _ {} "${PLAT}" "$failed_wheels" \;
7272

7373
if [[ -f "$failed_wheels" ]]; then
7474
echo "Repairing wheels failed:"

docs/IR.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ The dynamic-optional allows for more expressiveness than static-optional.
381381

382382
#### External Tensor Data
383383

384-
The raw data for large constant tensors, such as initializers, MAY be serialised in a separate file. In such a case, the tensor MUST provide the filename relative to the model file and MUST NOT use the value fields. It MAY provide a byte offset and length within that file. It MAY also specify a SHA1 digest of the file. One file MAY contain the data for multiple tensors.
384+
The raw data for large constant tensors, such as initializers, MAY be serialized in a separate file. In such a case, the tensor MUST provide the filename relative to the model file and MUST NOT use the value fields. It MAY provide a byte offset and length within that file. It MAY also specify a SHA1 digest of the file. One file MAY contain the data for multiple tensors.
385385

386386
More details can be found in [External Data](ExternalData.md).
387387

onnx/checker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "onnx/checker.h"
66

7-
#include <filesystem>
7+
#include <filesystem> // NOLINT(build/c++17)
88
#include <iostream>
99
#include <string>
1010
#include <unordered_map>

onnx/common/array_ref.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class ArrayRef {
6161
/*implicit*/ ArrayRef() : Data(nullptr), Length(0) {}
6262

6363
/// Construct an ArrayRef from a single element.
64-
/// NOLINTNEXTLINE(google-explicit-constructor)
64+
// NOLINTNEXTLINE(google-explicit-constructor, runtime/explicit)
6565
/*implicit*/ ArrayRef(const T& OneElt) : Data(&OneElt), Length(1) {}
6666

6767
/// Construct an ArrayRef from a pointer and length.
@@ -72,17 +72,17 @@ class ArrayRef {
7272

7373
/// Construct an ArrayRef from a std::vector.
7474
template <typename A>
75-
/// NOLINTNEXTLINE(google-explicit-constructor)
75+
// NOLINTNEXTLINE(google-explicit-constructor, runtime/explicit)
7676
/*implicit*/ ArrayRef(const std::vector<T, A>& Vec) : Data(Vec.data()), Length(Vec.size()) {}
7777

7878
/// Construct an ArrayRef from a std::array
7979
template <size_t N>
80-
/// NOLINTNEXTLINE(google-explicit-constructor)
80+
// NOLINTNEXTLINE(google-explicit-constructor, runtime/explicit)
8181
/*implicit*/ constexpr ArrayRef(const std::array<T, N>& Arr) : Data(Arr.data()), Length(N) {}
8282

8383
/// Construct an ArrayRef from a C array.
8484
template <size_t N>
85-
/// NOLINTNEXTLINE(google-explicit-constructor, *array*)
85+
// NOLINTNEXTLINE(google-explicit-constructor, runtime/explicit)
8686
/*implicit*/ constexpr ArrayRef(const T (&Arr)[N]) : Data(Arr), Length(N) {}
8787

8888
/// Construct an ArrayRef from a std::initializer_list.

onnx/common/common.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
abort(); \
1414
} while (false)
1515

16-
#define ONNX_THROW_EX(ex) \
17-
do { \
18-
std::cerr << ex.what() << std::endl; \
19-
abort(); \
16+
#define ONNX_THROW_EX(ex) \
17+
do { \
18+
std::cerr << ex.what() << std::endl; /* NOLINT */ \
19+
abort(); \
2020
} while (false)
2121

2222
#define ONNX_TRY if (true)

onnx/common/file_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#pragma once
66

7-
#include <filesystem>
7+
#include <filesystem> // NOLINT(build/c++17)
88
#include <fstream>
99
#include <string>
1010

onnx/common/interned_strings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ enum BuiltinSymbol : std::uint8_t {
197197

198198
struct Symbol {
199199
Symbol() = default;
200-
// NOLINTNEXTLINE(google-explicit-constructor)
200+
// NOLINTNEXTLINE(google-explicit-constructor, runtime/explicit)
201201
/*implicit*/ Symbol(BuiltinSymbol value) : value(value) {}
202202
explicit Symbol(const std::string& s);
203203
explicit Symbol(uint32_t value) : value(value) {}

onnx/common/ir.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,9 +1276,9 @@ struct Graph final {
12761276
}
12771277
};
12781278

1279-
inline Value::Value(Node* node_, size_t offset_)
1280-
: node_(node_), offset_(offset_), unique_(node_->graph_->getNextUnique()), stage_(node_->graph_->new_node_stage_) {
1281-
node_->graph_->all_values.emplace(this);
1279+
inline Value::Value(Node* node, size_t offset)
1280+
: node_(node), offset_(offset), unique_(node->graph_->getNextUnique()), stage_(node->graph_->new_node_stage_) {
1281+
node->graph_->all_values.emplace(this);
12821282
}
12831283

12841284
inline Graph* Value::owningGraph() {

onnx/defs/rnn/old.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ static std::function<void(OpSchema&)> RNNDocGeneratorOld(const char* /*name*/) {
394394
"Specify if the RNN is forward, reverse, or bidirectional. "
395395
"Must be one of forward (default), reverse, or bidirectional.",
396396
AttributeProto::STRING,
397-
std::string("foward"));
397+
std::string("foward")); // reviewdog:ignore[misspell], don't fix that typo, it's fixed in newer versions
398398
schema.Attr("hidden_size", "Number of neurons in the hidden layer", AttributeProto::INT, OPTIONAL_VALUE);
399399
schema.Attr(
400400
"activation_alpha",

0 commit comments

Comments
 (0)