Support register custom OpSchema by python #5906
clang-tidy-review
There were 6 warnings
Details
onnx/defs/schema.h:1213: warning: method 'UpdateDomainToVersion' can be made static [readability-convert-member-functions-to-static]
onnx/defs/schema.h:1213: warning: 2 adjacent parameters of 'UpdateDomainToVersion' of similar type ('int') are easily swapped by mistake [bugprone-easily-swappable-parameters]
onnx/defs/schema.h:1253: warning: the parameter 'op_schema' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
onnx/defs/schema.h:1268: warning: variable name 'm' is too short, expected at least 3 characters [readability-identifier-length]
onnx/defs/schema.h:1269: warning: 'auto &op_name' can be declared as 'const auto &op_name' [readability-qualified-auto]
onnx/defs/schema.h:1270: warning: 'auto &op_domain' can be declared as 'const auto &op_domain' [readability-qualified-auto]
Annotations
Check warning on line 1213 in onnx/defs/schema.h
github-actions / clang-tidy-review
clang-tidy
warning: method 'UpdateDomainToVersion' can be made static [readability-convert-member-functions-to-static]
onnx/defs/schema.h:1211:
```diff
- void
+ static void
```
Check warning on line 1213 in onnx/defs/schema.h
github-actions / clang-tidy-review
clang-tidy
warning: 2 adjacent parameters of 'UpdateDomainToVersion' of similar type ('int') are easily swapped by mistake [bugprone-easily-swappable-parameters]
```cpp
UpdateDomainToVersion(const std::string& domain, int min_version, int max_version, int last_release_version = -1) {
^
```
<details>
<summary>Additional context</summary>
**onnx/defs/schema.h:1212:** the first parameter in the range is 'min_version'
```cpp
UpdateDomainToVersion(const std::string& domain, int min_version, int max_version, int last_release_version = -1) {
^
```
**onnx/defs/schema.h:1212:** the last parameter in the range is 'max_version'
```cpp
UpdateDomainToVersion(const std::string& domain, int min_version, int max_version, int last_release_version = -1) {
^
```
</details>
Check warning on line 1253 in onnx/defs/schema.h
github-actions / clang-tidy-review
clang-tidy
warning: the parameter 'op_schema' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
```suggestion
OpSchemaRegisterOnce(const OpSchema& op_schema, int opset_version_to_load = 0, bool fail_duplicate_schema = true) {
```
Check warning on line 1268 in onnx/defs/schema.h
github-actions / clang-tidy-review
clang-tidy
warning: variable name 'm' is too short, expected at least 3 characters [readability-identifier-length]
```cpp
auto& m = GetMapWithoutEnsuringRegistration();
^
```
Check warning on line 1269 in onnx/defs/schema.h
github-actions / clang-tidy-review
clang-tidy
warning: 'auto &op_name' can be declared as 'const auto &op_name' [readability-qualified-auto]
```suggestion
const auto& op_name = op_schema.Name();
```
Check warning on line 1270 in onnx/defs/schema.h
github-actions / clang-tidy-review
clang-tidy
warning: 'auto &op_domain' can be declared as 'const auto &op_domain' [readability-qualified-auto]
```suggestion
const auto& op_domain = op_schema.domain();
```