Skip to content

add existing only mode #4

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

Open
wants to merge 2 commits into
base: init
Choose a base branch
from
Open

add existing only mode #4

wants to merge 2 commits into from

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:56
Copy link

@Copilot 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 adds a new "existing only mode" that ensures only functions with an existing docstring are updated with exception documentation. Key changes include:

  • Updating test cases to validate that functions without a docstring remain unchanged.
  • Modifying process_directory and CLI argument parsing in cli.py to support a new only_existing flag.
  • Enhancing docstring_utils.py to conditionally update docstrings based on the presence of an existing docstring.

Reviewed Changes

File Description
src/auto_detect_exceptions/tests/test_cli.py Adds a new test to verify that only functions with an existing docstring are updated.
src/auto_detect_exceptions/tests/test_docstring_utils.py Modifies the test to assert that functions lacking a docstring are not updated.
src/auto_detect_exceptions/cli.py Updates process_directory signature and CLI argument parsing to incorporate the only_existing flag.
src/auto_detect_exceptions/docstring_utils.py Extends DocstringUpdater and update_function_docstrings to conditionally update functions.

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

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.

1 participant