Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support register custom OpSchema by python #5906

Merged
merged 41 commits into from
Feb 23, 2024

fix py code style

17e7685
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Support register custom OpSchema by python #5906

fix py code style
17e7685
Select commit
Loading
Failed to load commit list.
GitHub Actions / clang-tidy-review completed Feb 10, 2024 in 0s

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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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();
```