Skip to content

Add overwrite cache option#52

Merged
obeone merged 2 commits into
mainfrom
codex/ajouter-option-pour-ecraser-le-cache
Jul 13, 2025
Merged

Add overwrite cache option#52
obeone merged 2 commits into
mainfrom
codex/ajouter-option-pour-ecraser-le-cache

Conversation

@obeone
Copy link
Copy Markdown
Owner

@obeone obeone commented Jul 13, 2025

Summary

  • add --overwrite-cache CLI flag
  • remove existing database when option enabled
  • document overwrite-cache flag
  • test cache overwrite logic
  • add -w short argument for overwrite cache

Testing

  • ruff check .
  • pytest -q

https://chatgpt.com/codex/tasks/task_e_6873c4b0bbe0832ebf801bde6afc445a

Summary by CodeRabbit

  • New Features
    • Added a new command-line option to overwrite the existing cache database before scraping.
  • Documentation
    • Updated usage instructions and options list in the README to include the new cache overwrite flag.
  • Tests
    • Introduced tests to verify correct behavior when the cache overwrite option is used.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 13, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

A new --overwrite-cache (-w) command-line flag was introduced to the crawler-to-md tool, allowing users to force deletion of any existing cache database before scraping. The README was updated to document this feature, and new tests were added to verify the correct behavior of the overwrite option in both long and short forms.

Changes

File(s) Change Summary
README.md Documented the new --overwrite-cache (-w) flag, updated usage instructions and options list accordingly.
crawler_to_md/cli.py Added --overwrite-cache (-w) CLI argument; deletes existing cache DB if flag is set before scraping begins.
tests/test_cli.py Added tests to verify cache overwrite behavior for both long and short flag variants.

Poem

A cache anew, with just one flag,
The crawler hops and clears the bag.
With -w or --overwrite-cache,
Old data gone, no need to patch!
The tests all cheer, the docs align—
Fresh starts for every bunny line.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ef6e96b and 48e0815.

📒 Files selected for processing (1)
  • crawler_to_md/cli.py (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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
Copy Markdown
Contributor

@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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53d1a4f and ef6e96b.

📒 Files selected for processing (3)
  • README.md (2 hunks)
  • crawler_to_md/cli.py (2 hunks)
  • tests/test_cli.py (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-and-push
🔇 Additional comments (5)
crawler_to_md/cli.py (1)

53-59: LGTM! Well-structured argument parser configuration.

The argument parser configuration follows standard patterns with appropriate action, help text, and default value.

README.md (2)

55-55: LGTM! Comprehensive usage example update.

The usage example correctly includes the new option with both long and short forms.


64-64: LGTM! Clear and consistent option description.

The option description follows the existing documentation style with appropriate emoji and clear explanation of the feature's purpose.

tests/test_cli.py (2)

184-214: LGTM! Comprehensive test coverage for the overwrite cache functionality.

The test properly validates that the cache file is removed when the --overwrite-cache flag is used. The mocking approach is appropriate and the test logic is sound.


217-247: LGTM! Good coverage of the short option form.

This test ensures that the short form -w works identically to the long form --overwrite-cache. The test structure mirrors the previous test appropriately.

Comment thread crawler_to_md/cli.py Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@obeone obeone merged commit dc63ef5 into main Jul 13, 2025
3 of 4 checks passed
@obeone obeone deleted the codex/ajouter-option-pour-ecraser-le-cache branch July 13, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant