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

Remove deprecated flags and their migration. #2410

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

DarkaMaul
Copy link
Contributor

@DarkaMaul DarkaMaul commented Apr 8, 2024

This PR solves #2351

It removes the deprecated flags, the migration handler and their usage in some test file.

Summary by CodeRabbit

  • Refactor
    • Streamlined the configuration file reading process by removing deprecated flags and related migration logic.
  • Tests
    • Adjusted end-to-end tests to reflect changes in failure conditions and path filtering criteria in configuration settings.

Copy link

coderabbitai bot commented Apr 8, 2024

Walkthrough

The recent modifications streamline the Slither tool's configuration handling by removing outdated options and simplifying the process of reading config files. Additionally, there's a tweak in the tool's behavior towards failure conditions and path filtering in tests, making it more flexible in handling specific issues and file paths.

Changes

File Path Summary of Changes
slither/utils/command_line.py Removed deprecated_flags and logic for migrating deprecated config options.
tests/e2e/config/test_path_filtering/slither.config.json Adjusted failure conditions and updated path filtering criteria.

🐇✨
Changes abound, in code, we trust,
Deprecated gone, in progress, we must.
Paths now clear, and failures just,
Streamlined we hop, in Slither, we thrust.
🌟🐰💻

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?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between fdf54f6 and 2bd6cbe.
Files selected for processing (2)
  • slither/utils/command_line.py (3 hunks)
  • tests/e2e/config/test_path_filtering/slither.config.json (1 hunks)
Additional comments not posted (4)
tests/e2e/config/test_path_filtering/slither.config.json (2)

5-5: Change in failure condition setting to not fail on any specific condition enhances configuration flexibility.


6-6: Adjustment in path filtering criteria likely improves test efficiency or relevance.

slither/utils/command_line.py (2)

Line range hint 1-1: Ensure all references to removed deprecated flags and the migrate_config_options function have been cleaned up.

Verification successful

The executed script searched the codebase for any remaining references to deprecated_flags or the migrate_config_options function and did not produce any output. This indicates that these references have likely been successfully removed or are not present in the codebase, aligning with the intended changes mentioned in the review comment.

Given this information, it appears that the removal of deprecated flags and the migration handler function has been handled correctly, with no lingering references found in the Python files of the project.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for any remaining references to deprecated flags or the migrate_config_options function.
rg --type py 'deprecated_flags|migrate_config_options'

Length of output: 56


Line range hint 1-1: Review the impact of removing deprecated functionality on the overall configuration and testing process.

@montyly montyly changed the base branch from master to dev April 8, 2024 09:43
@@ -2,6 +2,6 @@
"detectors_to_run": "all",
"exclude_informational": true,
"exclude_low": true,
"fail_pedantic": false,
"fail_on": "none",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is different than the current default and may mess up CI usage
cc @elopez

Copy link
Member

Choose a reason for hiding this comment

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

this is config for a test though, right? it's not a default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

    if key.startswith("fail_") and getattr(args, "fail_on") == defaults_flag_in_config["fail_on"]:
        if key == "fail_pedantic":
            pedantic_setting = elem
            fail_on = FailOnLevel.PEDANTIC if pedantic_setting else FailOnLevel.NONE
            setattr(args, "fail_on", fail_on)
            logger.info(f"Migrating fail_pedantic: {pedantic_setting} as fail_on: {fail_on.value}")

The original migration was like this so I think fail_pedantic: False was migrated to fail_on: None

@0xalpharush 0xalpharush merged commit ae0cb5b into crytic:dev Apr 15, 2024
74 checks passed
@DarkaMaul DarkaMaul deleted the feature/remove-flags-2351 branch April 26, 2024 03:01
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.

3 participants