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

Switch to Github Actions Code Scanner #1739

Merged
merged 3 commits into from
Oct 27, 2022

Conversation

thomas-bc
Copy link
Collaborator

Originating Project/Creator
Affected Component
Affected Architectures(s) Github Actions
Related Issue(s) #1693
Has Unit Tests (y/n)
Builds Without Errors (y/n)
Unit Tests Pass (y/n)
Documentation Included (y/n)

Change Description

Adds a Github Actions workflow that runs the same queries as the current LGTM set up.

Rationale

lgtm.com will be shut down at the end of the year.

Future Work

We may want to remove the LGTM configuration files once it's fully shut down.

Additional comments

I currently have it set up to run on each commit and pull request to master and devel as I see this seems to be the convention in the workflows of this repo, but we could restrict to only running when source files are modified.

Here's the result of the queries on Github Actions results. Comparing to the LGTM results, we see the same warnings with an additional 2 on the Github Actions side.

@thomas-bc thomas-bc requested a review from LeStarch October 27, 2022 00:51
@thomas-bc thomas-bc self-assigned this Oct 27, 2022
Copy link
Collaborator

@LeStarch LeStarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. We should fix the one error, so that doesn't count against us. Then we'll merge.

@lgtm-com
Copy link

lgtm-com bot commented Oct 27, 2022

This pull request fixes 1 alert when merging 3feac2b into 8855f31 - view on LGTM.com

fixed alerts:

  • 1 for Potentially uninitialized local variable

@thomas-bc
Copy link
Collaborator Author

I added in the fix for the Python error. Turns out the if statement isn't needed at all, the behavior would be the same for any list length >0. There is no check to ensure that the list isn't empty though, but I didn't want to risk to break things in the scope of this PR so I didn't add that. It also looks like these functions aren't used anyways.

Copy link
Collaborator

@LeStarch LeStarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

@LeStarch
Copy link
Collaborator

This fix looks right to me. Also .split should never return an empty list as it would always return back a list of at least one element.

@LeStarch LeStarch merged commit 22759cc into nasa:devel Oct 27, 2022
@thomas-bc thomas-bc deleted the workflow/gh-code-scanner branch September 29, 2023 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants