-
Notifications
You must be signed in to change notification settings - Fork 979
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
sync dev <> master #2493
sync dev <> master #2493
Conversation
chore: recommend upgrading in issue template
sync master <> dev
fix ordering and dead-code detector
WalkthroughWalkthroughThe recent updates involve improvements to the GitHub issue template for bug reporting and enhancements to the Slither tool. The template now includes clearer instructions and better formatting for issue reports. In Slither, the detector sorting logic has been optimized, and dead code detection functionality has been refined to skip unnecessary checks. Changes
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range and nitpick comments (1)
slither/__main__.py (1)
Line range hint
850-850
: Remove extraneous parentheses to improve readability.The static analysis tool flagged the use of unnecessary parentheses. Removing these will clean up the code and enhance readability.
- if (args.legacy_ast): + if args.legacy_ast:
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (3)
- .github/ISSUE_TEMPLATE/bug_report.yml (3 hunks)
- slither/main.py (2 hunks)
- slither/detectors/functions/dead_code.py (1 hunks)
Files skipped from review due to trivial changes (2)
- .github/ISSUE_TEMPLATE/bug_report.yml
- slither/detectors/functions/dead_code.py
Additional context used
Ruff
slither/__main__.py
850-850: Avoid extraneous parentheses (UP034)
Remove extraneous parentheses
@@ -239,6 +239,7 @@ def choose_detectors( | |||
set(detectors_to_run), args.detectors_to_include, detectors | |||
) | |||
|
|||
detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor the sorting logic for clarity and efficiency.
Sorting detectors_to_run
by the IMPACT
attribute enhances the execution order of detectors based on their importance, which is a crucial improvement for performance and prioritization. However, consider using a more explicit attribute for sorting, such as IMPACT_PRIORITY
, to make the purpose of the sorting clearer and to avoid potential confusion with the impact level (e.g., severity).
- detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT)
+ detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT_PRIORITY)
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT) | |
detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT_PRIORITY) |
Summary by CodeRabbit
Documentation
Improvements