Skip to content

Conversation

@Saga4
Copy link
Contributor

@Saga4 Saga4 commented Jun 4, 2025

PR Type

Bug fix


Description

  • Refactor blocklist filter condition for clarity

  • Add comments explaining skip/keep logic

  • Ensure removed count increments on blocklist hit

  • Preserve all non-blocklisted functions


Changes walkthrough 📝

Relevant files
Bug fix
functions_to_optimize.py
Clarify blocklist function filtering                                         

codeflash/discovery/functions_to_optimize.py

  • Replaced negated blocklist check with positive condition
  • Added comments for skipping and keeping functions
  • Incremented blocklist_funcs_removed_count on skip
  • +3/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @github-actions
    Copy link

    github-actions bot commented Jun 4, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Test Coverage

    Ensure that the updated blocklist filtering logic is covered by unit tests for both blocklisted and non-blocklisted functions to prevent regressions.

    try:
        ast.parse(f"import {module_name_from_file_path(Path(file_path), project_root)}")
    except SyntaxError:
        malformed_paths_count += 1
        continue
    if blocklist_funcs:
        functions_tmp = []
        for function in _functions:
            if (
                function.file_path.name in blocklist_funcs
                and function.qualified_name in blocklist_funcs[function.file_path.name]
            ):
                # This function is in blocklist, we can skip it
                blocklist_funcs_removed_count += 1
                continue
            # This function is NOT in blocklist. we can keep it
            functions_tmp.append(function)
        _functions = functions_tmp

    @github-actions
    Copy link

    github-actions bot commented Jun 4, 2025

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @Saga4 Saga4 requested review from KRRT7 and misrasaurabh1 and removed request for misrasaurabh1 June 4, 2025 20:14
    @aseembits93
    Copy link
    Contributor

    how can i test this part of the code? @Saga4

    @Saga4 Saga4 merged commit 4f1230f into main Jun 4, 2025
    16 of 17 checks passed
    KRRT7 pushed a commit that referenced this pull request Jun 6, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    4 participants