-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add CodeQL workflow for GitHub code scanning and fix few bugs it detected #1165
Conversation
Codecov ReportBase: 88.27% // Head: 63.35% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1165 +/- ##
===========================================
- Coverage 88.27% 63.35% -24.92%
===========================================
Files 73 73
Lines 8817 8809 -8
===========================================
- Hits 7783 5581 -2202
- Misses 1034 3228 +2194
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
oh boy,
@jwodder could you please review and address one way (fix all) or another (skip some) or state your verdict on why we should not bother with CodeQL. |
@yarikoptic Where are you seeing that text? |
on the run for added workflow action: https://github.com/dandi/dandi-cli/pull/1165/checks?check_run_id=9750642454 |
@yarikoptic Please explain the comment here: dandi-cli/dandi/tests/fixtures.py Lines 259 to 261 in 0439caf
CodeQL complains about the use of |
@TheChymera Please explain what the point of the dandi-cli/dandi/cli/cmd_validate.py Lines 196 to 213 in b3b7909
|
@yarikoptic Aside from the issues related to the above two comments, I fixed a few of the issues and marked the rest as either false positives or "won't fix" (because the given code is that way deliberately). Now that those issues have been dismissed, they hopefully shouldn't come back. |
I guess so - please refactor as you see fit. Unfortunately I am not even sure I understand exactly what collision across scopes I had in mind |
@jwodder There was no point, I used the wrong variable name. This is part of the logic which isn't really tested, but to explain the concept which I had intended for whenever we will have a use case, the idea is to auto-determine grouping by the length of the inputs, so that the grouping logic is handled by the cli function and doesn't need to pass an argument further down the line. Ideally you can mix it up in any way you want and the function should be able to figure out how to show it. The |
Hi
dandi/dandi-cli
!This is a one-off automatically generated pull request from LGTM.com 🤖. You might have heard that we’ve integrated LGTM’s underlying CodeQL analysis engine natively into GitHub. The result is GitHub code scanning!
With LGTM fully integrated into code scanning, we are focused on improving CodeQL within the native GitHub code scanning experience. In order to take advantage of current and future improvements to our analysis capabilities, we suggest you enable code scanning on your repository. Please take a look at our blog post for more information.
This pull request enables code scanning by adding an auto-generated
codeql.yml
workflow file for GitHub Actions to your repository — take a look! We tested it before opening this pull request, so all should be working ✔️. In fact, you might already have seen some alerts appear on this pull request!Where needed and if possible, we’ve adjusted the configuration to the needs of your particular repository. But of course, you should feel free to tweak it further! Check this page for detailed documentation.
Questions? Check out the FAQ below!
FAQ
Click here to expand the FAQ section
How often will the code scanning analysis run?
By default, code scanning will trigger a scan with the CodeQL engine on the following events:
What will this cost?
Nothing! The CodeQL engine will run inside GitHub Actions, making use of your unlimited free compute minutes for public repositories.
What types of problems does CodeQL find?
The CodeQL engine that powers GitHub code scanning is the exact same engine that powers LGTM.com. The exact set of rules has been tweaked slightly, but you should see almost exactly the same types of alerts as you were used to on LGTM.com: we’ve enabled the
security-and-quality
query suite for you.How do I upgrade my CodeQL engine?
No need! New versions of the CodeQL analysis are constantly deployed on GitHub.com; your repository will automatically benefit from the most recently released version.
The analysis doesn’t seem to be working
If you get an error in GitHub Actions that indicates that CodeQL wasn’t able to analyze your code, please follow the instructions here to debug the analysis.
How do I disable LGTM.com?
If you have LGTM’s automatic pull request analysis enabled, then you can follow these steps to disable the LGTM pull request analysis. You don’t actually need to remove your repository from LGTM.com; it will automatically be removed in the next few months as part of the deprecation of LGTM.com (more info here).
Which source code hosting platforms does code scanning support?
GitHub code scanning is deeply integrated within GitHub itself. If you’d like to scan source code that is hosted elsewhere, we suggest that you create a mirror of that code on GitHub.
How do I know this PR is legitimate?
This PR is filed by the official LGTM.com GitHub App, in line with the deprecation timeline that was announced on the official GitHub Blog. The proposed GitHub Action workflow uses the official open source GitHub CodeQL Action. If you have any other questions or concerns, please join the discussion here in the official GitHub community!
I have another question / how do I get in touch?
Please join the discussion here to ask further questions and send us suggestions!