Skip to content

Conversation

jcwchen
Copy link
Member

@jcwchen jcwchen commented Aug 24, 2022

Description

Fix global LGTM Python/C++ warnings and fully enable this check in more files to enhance code quality. The warnings are:
Python:

  • Remove unused library
  • To be more informative, use assertEqual instead of assertTrue
  • Reduce unreachable if

C++:

  • Use const & when the input variable is too large
  • No matching copy assignment operator in class LexicalScopeContext. It is good practice to match a copy constructor with a copy assignment operator.

Motivation and Context

LGTM excludes check for some files like test files (reference). You can see the full error report including excluded files by here. It would be great if we can fix these errors.: #3650 (comment)

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
@jcwchen jcwchen requested review from a team as code owners August 24, 2022 21:05
@lgtm-com
Copy link

lgtm-com bot commented Aug 24, 2022

This pull request fixes 1 alert when merging 037359b into 9b8c8d2 - view on LGTM.com

fixed alerts:

  • 1 for Module is imported with 'import' and 'import from'

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
@jcwchen jcwchen changed the title [WIP] Fix global LGTM Python/C++ warnings and fully enable it Fix global LGTM Python/C++ warnings and fully enable it Aug 24, 2022
@lgtm-com
Copy link

lgtm-com bot commented Aug 24, 2022

This pull request fixes 1 alert when merging 6150b2d into 9b8c8d2 - view on LGTM.com

fixed alerts:

  • 1 for Inconsistent definition of copy constructor and assignment ('Rule of Two')

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
@lgtm-com
Copy link

lgtm-com bot commented Aug 24, 2022

This pull request fixes 1 alert when merging f19594a into 9b8c8d2 - view on LGTM.com

fixed alerts:

  • 1 for Inconsistent definition of copy constructor and assignment ('Rule of Two')

@jcwchen jcwchen enabled auto-merge (squash) September 14, 2022 21:13
@lgtm-com
Copy link

lgtm-com bot commented Sep 14, 2022

This pull request fixes 1 alert when merging 6625dc0 into 5fbb7b5 - view on LGTM.com

fixed alerts:

  • 1 for Inconsistent definition of copy constructor and assignment ('Rule of Two')

@jcwchen jcwchen merged commit 0853147 into onnx:main Sep 14, 2022
@jcwchen jcwchen deleted the jcw/clean-up branch September 14, 2022 21:25
prasanthpul pushed a commit that referenced this pull request Oct 5, 2022
* Fix global LGTM warnings and fully enable it

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* - Exclude: py/import-and-import-from

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix the rest of warnings

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* remove unnecessary if

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
Signed-off-by: Prasanth Pulavarthi <prasanth.pulavarthi@microsoft.com>
prasanthpul pushed a commit that referenced this pull request Jan 26, 2023
* Fix global LGTM warnings and fully enable it

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* - Exclude: py/import-and-import-from

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix the rest of warnings

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* remove unnecessary if

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
Signed-off-by: Prasanth Pulavarthi <prasanth.pulavarthi@microsoft.com>
broune pushed a commit to broune/onnx that referenced this pull request May 6, 2023
* Fix global LGTM warnings and fully enable it

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* - Exclude: py/import-and-import-from

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* fix the rest of warnings

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

* remove unnecessary if

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants