Skip to content

Conversation

@lucemia
Copy link
Contributor

@lucemia lucemia commented Mar 10, 2025

No description provided.

@lucemia lucemia requested a review from Copilot March 10, 2025 09:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR is an initial commit that sets up the auto-detect-exceptions project. It introduces project configuration, core functionality for detecting unhandled exceptions in Python functions, a CLI interface, and a comprehensive test suite.

  • Added a pyproject.toml file with project and dependency settings.
  • Implemented exception detection logic in several modules and provided corresponding tests.
  • Introduced a CLI and docstring updater utility using libcst.

Reviewed Changes

File Description
pyproject.toml Configuration of project metadata and dependency management.
src/auto_detect_exceptions/detect.py Added functions to retrieve file paths and detect exceptions in functions.
src/auto_detect_exceptions/cli.py Introduced the CLI interface and report generation functionality.
src/auto_detect_exceptions/tests/* Added tests covering AST parsing, docstring updates, exception detection.
src/auto_detect_exceptions/bk/exception_analyzer.py Added experimental backup version of the exception analyzer.
src/auto_detect_exceptions/main.py, ast_utils.py, etc. Introduced core analysis functions and utilities.
.pre-commit-config.yaml Configured pre-commit hooks for code quality and formatting.

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/auto_detect_exceptions/bk/exception_analyzer copy.py:1

  • [nitpick] The file name 'exception_analyzer copy.py' suggests it might be a backup or duplicate file; consider removing or renaming it to avoid confusion in the repository.
import ast

return file_path


def analyze_function(node) -> set[str]:
Copy link

Copilot AI Mar 10, 2025

Choose a reason for hiding this comment

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

The function 'analyze_function' initializes and visits an AST node but never returns a value, which causes 'detect_function_exceptions' to return None instead of the set of exceptions. Consider returning the relevant results (e.g., the collected exceptions) from the analyzer.

Copilot uses AI. Check for mistakes.
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