dreulavelle / PTT

The Best Damn Filename Parser You've Ever Used!
MIT License
9 stars 5 forks source link

Fix last tests #4

Closed davidemarcoli closed 7 months ago

davidemarcoli commented 7 months ago

Summary by CodeRabbit

coderabbitai[bot] commented 7 months ago

Walkthrough

The recent modifications in the project primarily focus on refining debug outputs and enhancing the efficiency of existing functionalities. The handlers.py file sees an adjustment in handler attributes and a streamlined process for episode number extraction. Meanwhile, parse.py optimizes debug message management by incorporating a conditional flag.

Changes

File Summary
.../handlers.py Adjusted remove attribute from True to False in handler settings and simplified episode number extraction logic.
.../parse.py Removed unnecessary print statements; added conditional debug printing based on the DEBUG_HANDLER flag.

🐰✨ A rabbit hopped through the code,
Tweaking lines where bugs once bode.
No more prints spill on the floor,
Handlers tweaked, less is more.
Hop, skip, a code ballet,
Debug whispers now hold sway.
🌟📜


Recent Review Details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 93cbdaf2d7964987f87a5362e15a3a6290cf5b8f and a1cf71bc68ade86aff50903f2934122f302f4263.
Files selected for processing (2) * PTT/handlers.py (3 hunks) * PTT/parse.py (3 hunks)
Additional Context Used
Ruff (130)
PTT/handlers.py (86)
1-10: Import block is un-sorted or un-formatted --- 10-10: `add_defaults` is too complex (19 > 10) --- 10-10: Too many statements (300 > 50) --- 106-106: Single quotes found but double quotes preferred --- 107-107: Single quotes found but double quotes preferred --- 109-109: Single quotes found but double quotes preferred --- 109-109: Single quotes found but double quotes preferred --- 148-148: Single quotes found but double quotes preferred --- 149-149: Single quotes found but double quotes preferred --- 150-150: Single quotes found but double quotes preferred --- 153-153: Single quotes found but double quotes preferred --- 153-153: Single quotes found but double quotes preferred --- 156-156: Single quotes found but double quotes preferred --- 160-160: Single quotes found but double quotes preferred --- 160-160: Single quotes found but double quotes preferred --- 160-160: Single quotes found but double quotes preferred --- 163-163: Single quotes found but double quotes preferred --- 167-167: Single quotes found but double quotes preferred --- 168-168: Single quotes found but double quotes preferred --- 169-169: Single quotes found but double quotes preferred --- 225-225: Single quotes found but double quotes preferred --- 226-226: Single quotes found but double quotes preferred --- 227-227: Single quotes found but double quotes preferred --- 229-229: Single quotes found but double quotes preferred --- 231-231: Single quotes found but double quotes preferred --- 231-231: Single quotes found but double quotes preferred --- 231-231: Single quotes found but double quotes preferred --- 231-231: Single quotes found but double quotes preferred --- 232-232: Single quotes found but double quotes preferred --- 233-233: Single quotes found but double quotes preferred --- 233-233: Single quotes found but double quotes preferred --- 233-233: Single quotes found but double quotes preferred --- 234-234: Single quotes found but double quotes preferred --- 234-234: Single quotes found but double quotes preferred --- 244-244: Single quotes found but double quotes preferred --- 244-244: Single quotes found but double quotes preferred --- 248-248: Single quotes found but double quotes preferred --- 249-249: Single quotes found but double quotes preferred --- 250-250: Single quotes found but double quotes preferred --- 367-367: Single quotes found but double quotes preferred --- 368-368: Single quotes found but double quotes preferred --- 369-369: Single quotes found but double quotes preferred --- 370-374: Use a single `if` statement instead of nested `if` statements --- 370-370: Single quotes found but double quotes preferred --- 370-370: Single quotes found but double quotes preferred --- 370-370: Single quotes found but double quotes preferred --- 370-370: Single quotes found but double quotes preferred --- 372-372: Single quotes found but double quotes preferred --- 372-372: Single quotes found but double quotes preferred --- 372-372: Single quotes found but double quotes preferred --- 372-372: Single quotes found but double quotes preferred --- 372-372: Single quotes found but double quotes preferred --- 374-374: Single quotes found but double quotes preferred --- 375-375: Single quotes found but double quotes preferred --- 375-375: Single quotes found but double quotes preferred --- 375-375: Single quotes found but double quotes preferred --- 377-377: Single quotes found but double quotes preferred --- 383-383: Single quotes found but double quotes preferred --- 384-384: Single quotes found but double quotes preferred --- 384-384: Single quotes found but double quotes preferred --- 384-384: Single quotes found but double quotes preferred --- 384-384: Single quotes found but double quotes preferred --- 385-385: Single quotes found but double quotes preferred --- 386-386: Single quotes found but double quotes preferred --- 393-393: Single quotes found but double quotes preferred --- 394-394: Single quotes found but double quotes preferred --- 395-395: Single quotes found but double quotes preferred --- 395-395: Single quotes found but double quotes preferred --- 395-395: Single quotes found but double quotes preferred --- 395-395: Single quotes found but double quotes preferred --- 395-395: Single quotes found but double quotes preferred --- 395-395: Single quotes found but double quotes preferred --- 395-395: Single quotes found but double quotes preferred --- 395-395: Single quotes found but double quotes preferred --- 396-396: Single quotes found but double quotes preferred --- 396-396: Single quotes found but double quotes preferred --- 396-396: Single quotes found but double quotes preferred --- 396-396: Single quotes found but double quotes preferred --- 396-396: Single quotes found but double quotes preferred --- 399-401: Use a single `if` statement instead of nested `if` statements --- 399-399: Single quotes found but double quotes preferred --- 399-399: Single quotes found but double quotes preferred --- 400-400: Single quotes found but double quotes preferred --- 401-401: Single quotes found but double quotes preferred --- 402-402: Single quotes found but double quotes preferred --- 403-403: Single quotes found but double quotes preferred
PTT/parse.py (44)
1-6: Import block is un-sorted or un-formatted --- 33-33: Single quotes found but double quotes preferred --- 34-34: Single quotes found but double quotes preferred --- 35-35: Single quotes found but double quotes preferred --- 37-37: Single quotes found but double quotes preferred --- 41-41: `print` found --- 42-42: `print` found --- 46-46: `print` found --- 54-54: Single quotes found but double quotes preferred --- 59-59: `print` found --- 60-60: Single quotes found but double quotes preferred --- 61-61: Single quotes found but double quotes preferred --- 66-66: Single quotes found but double quotes preferred --- 66-66: Single quotes found but double quotes preferred --- 67-67: Single quotes found but double quotes preferred --- 69-69: Single quotes found but double quotes preferred --- 70-70: Single quotes found but double quotes preferred --- 71-71: Single quotes found but double quotes preferred --- 71-71: Single quotes found but double quotes preferred --- 72-72: Single quotes found but double quotes preferred --- 72-72: Single quotes found but double quotes preferred --- 100-100: Unnecessary assignment to `cleaned_title` before `return` statement --- 112-112: Do not compare types, use `isinstance()` --- 114-114: Do not compare types, use `isinstance()` --- 116-116: Do not compare types, use `isinstance()` --- 124-124: `parse` is too complex (13 > 10) --- 140-140: `print` found --- 143-143: `print` found --- 144-144: `print` found --- 148-148: `print` found --- 149-149: `print` found --- 152-152: Single quotes found but double quotes preferred --- 153-153: Single quotes found but double quotes preferred --- 153-153: Single quotes found but double quotes preferred --- 154-154: Single quotes found but double quotes preferred --- 155-155: Single quotes found but double quotes preferred --- 155-155: Single quotes found but double quotes preferred --- 156-156: Single quotes found but double quotes preferred --- 157-157: Single quotes found but double quotes preferred --- 158-158: Single quotes found but double quotes preferred --- 158-158: Single quotes found but double quotes preferred --- 159-159: Single quotes found but double quotes preferred --- 164-164: `print` found --- 165-165: `print` found
Additional comments not posted (3)
PTT/parse.py (1)
`139-152`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [140-165] Conditional debug printing is correctly implemented. Ensure consistency in the use of quotes for string literals. ```diff - print(handler.handler_name) - print("Title before: " + title) - print("Title after: " + title) - print(end_of_title) + print(handler.handler_name) + print("Title before: " + title) + print("Title after: " + title) + print(end_of_title) ```
PTT/handlers.py (2)
`98-98`: Consider verifying the behavior change for the "source" handler. The change from `remove: True` to `remove: False` for the "source" handler with regex pattern for "DivX|XviD" might have implications on how data is processed in subsequent steps. Please ensure that this behavior change is intentional and tested, especially since the comment indicates uncertainty about why the test case fails with the original setting. --- `139-139`: Clarify the intended behavior for the "group" handler. The change from `remove: True` to `remove: False` for the "group" handler regex pattern is noted. Similar to the previous comment, it's important to verify that this change aligns with the intended parsing logic, especially since the comment indicates a discrepancy with the JavaScript implementation.
--- 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 - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
codecov[bot] commented 7 months ago

Welcome to Codecov :tada:

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered :open_umbrella: