Support register custom OpSchema by python #5906
clang-tidy-review
There were 8 warnings
Details
onnx/defs/schema.cc:41: warning: variable 'registration' of type 'OpSchemaRegistry::OpSchemaRegisterOnce' can be declared 'const' [misc-const-correctness]
onnx/defs/schema.h:1187: warning: method 'AddDomainToVersion' can be made static [readability-convert-member-functions-to-static]
onnx/defs/schema.h:1187: warning: 2 adjacent parameters of 'AddDomainToVersion' of similar type ('int') are easily swapped by mistake [bugprone-easily-swappable-parameters]
onnx/defs/schema.h:1211: warning: method 'UpdateDomainToVersion' can be made static [readability-convert-member-functions-to-static]
onnx/defs/schema.h:1211: warning: 2 adjacent parameters of 'UpdateDomainToVersion' of similar type ('int') are easily swapped by mistake [bugprone-easily-swappable-parameters]
onnx/defs/schema.h:1261: warning: variable name 'm' is too short, expected at least 3 characters [readability-identifier-length]
onnx/defs/schema.h:1262: warning: 'auto &op_name' can be declared as 'const auto &op_name' [readability-qualified-auto]
onnx/defs/schema.h:1263: warning: 'auto &op_domain' can be declared as 'const auto &op_domain' [readability-qualified-auto]
Annotations
Check warning on line 41 in onnx/defs/schema.cc
github-actions / clang-tidy-review
clang-tidy
warning: variable 'registration' of type 'OpSchemaRegistry::OpSchemaRegisterOnce' can be declared 'const' [misc-const-correctness]
```suggestion
OpSchemaRegistry::OpSchemaRegisterOnce ONNX_UNUSED const registration(
```
Check warning on line 1187 in onnx/defs/schema.h
github-actions / clang-tidy-review
clang-tidy
warning: method 'AddDomainToVersion' can be made static [readability-convert-member-functions-to-static]
```suggestion
static void AddDomainToVersion(const std::string& domain, int min_version, int max_version, int last_release_version) {
```
Check warning on line 1187 in onnx/defs/schema.h
github-actions / clang-tidy-review
clang-tidy
warning: 2 adjacent parameters of 'AddDomainToVersion' of similar type ('int') are easily swapped by mistake [bugprone-easily-swappable-parameters]
```cpp
void AddDomainToVersion(const std::string& domain, int min_version, int max_version, int last_release_version) {
^
```
<details>
<summary>Additional context</summary>
**onnx/defs/schema.h:1186:** the first parameter in the range is 'min_version'
```cpp
void AddDomainToVersion(const std::string& domain, int min_version, int max_version, int last_release_version) {
^
```
**onnx/defs/schema.h:1186:** the last parameter in the range is 'max_version'
```cpp
void AddDomainToVersion(const std::string& domain, int min_version, int max_version, int last_release_version) {
^
```
</details>
Check warning on line 1211 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]
```suggestion
static void UpdateDomainToVersion(const std::string& domain, int min_version, int max_version, int last_release_version) {
```
Check warning on line 1211 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
void UpdateDomainToVersion(const std::string& domain, int min_version, int max_version, int last_release_version) {
^
```
<details>
<summary>Additional context</summary>
**onnx/defs/schema.h:1210:** the first parameter in the range is 'min_version'
```cpp
void UpdateDomainToVersion(const std::string& domain, int min_version, int max_version, int last_release_version) {
^
```
**onnx/defs/schema.h:1210:** the last parameter in the range is 'max_version'
```cpp
void UpdateDomainToVersion(const std::string& domain, int min_version, int max_version, int last_release_version) {
^
```
</details>
Check warning on line 1261 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 1262 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 1263 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();
```