Skip to content
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

[pt] Fixed and removed "temp_off" from rule ID:PARA_NADA_DESNECESSARIAMENTE #10908

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

marcoagpinto
Copy link
Member

@marcoagpinto marcoagpinto commented Oct 2, 2024

Heya, @susanaboatto and @p-goulart ,

Susana, the rule only gave one hit, and it was a false positive, and I have just fixed it:
Screenshot 2024-10-02 at 06-35-05 ChatGPT

RESULTS URL: https://internal1.languagetool.org/regression-tests/via-http/2024-10-01/pt-BR/result_style_PARA_NADA_DESNECESSARIAMENTE%5B1%5D.html

Thanks!

Summary by CodeRabbit

  • New Features

    • Enhanced language rule for improved accuracy in identifying incorrect usages of "não" followed by specific verbs and nouns.
  • Bug Fixes

    • Removed the temporary deactivation of the rule, ensuring it is always active for users.

Copy link

coderabbitai bot commented Oct 2, 2024

Warning

Rate limit exceeded

@marcoagpinto has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 10 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Files that changed from the base of the PR and between bf09591 and bcf5b76.

Walkthrough

The pull request modifies the PARA_NADA_DESNECESSARIAMENTE rule in the style.xml file. Key changes include the addition of an antipattern section that specifies exceptions related to the negation "não" followed by certain verbs and nouns. The existing pattern section remains unchanged, and the default attribute has been removed, enhancing the rule's specificity and accuracy in identifying incorrect usages.

Changes

File Path Change Summary
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/style.xml - Updated rule PARA_NADA_DESNECESSARIAMENTE: removed default='temp_off' attribute.
- Added antipattern section with specific tokens and example sentence.

Possibly related PRs

Suggested reviewers

  • p-goulart
  • susanaboatto

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
🪧 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.
    • 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 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 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 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

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

🧹 Outside diff range and nitpick comments (2)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/style.xml (2)

3622-3629: Antipattern addition: Approved with a suggestion

The addition of the antipattern is a good improvement to prevent false positives. It correctly identifies cases where "para nada" is used appropriately in conjunction with negation and specific verbs.

Consider adding a comment explaining the purpose of this antipattern for better maintainability. For example:

 <antipattern>
+    <!-- This antipattern prevents false positives when "para nada" is used appropriately with negation and specific verbs -->
     <token>não</token>
     <token regexp='yes' inflected='yes'>conceder|concluir|determinar|esperar|finalizar|obter</token> <!-- Exceptions for below -->
     ...
 </antipattern>

3631-3631: Existing pattern: Approved with a suggestion for future improvement

The existing pattern remains unchanged and works well in conjunction with the new antipattern to improve the rule's accuracy.

For future improvements, consider breaking down the long list of verbs into semantic groups or categories. This could make the rule more maintainable and easier to update. For example:

<token regexp='yes' inflected='yes'>
  <!-- Action verbs -->
  adjudicar|administrar|aplicar|arranjar|assentar|atuar|...
  |
  <!-- Cognitive verbs -->
  analisar|antecipar|avaliar|considerar|decidir|...
  |
  <!-- Communication verbs -->
  explicar|persuadir|reafirmar|reiterar|...
</token>

This structure would make it easier to add, remove, or modify verbs within specific categories.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ed422d6 and bf09591.

📒 Files selected for processing (1)
  • languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/style.xml (1 hunks)
🔇 Additional comments (2)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/style.xml (2)

3620-3631: Summary: Changes approved with minor suggestions

The modifications to the 'PARA_NADA_DESNECESSARIAMENTE' rule effectively address the PR objectives:

  1. The rule has been activated by removing the 'temp_off' attribute.
  2. An antipattern has been added to prevent false positives.
  3. The existing pattern remains unchanged, maintaining its intended functionality.

These changes should improve the accuracy of the language tool for detecting unnecessary uses of "para nada" while avoiding false positives in valid contexts.

The suggestions provided (adding a comment to the antipattern and considering a restructure of the verb list in the future) are aimed at improving maintainability and do not affect the current functionality of the rule.


3620-3620: LGTM: Rule activation approved

The removal of default="temp_off" from the rule declaration effectively activates the rule, which aligns with the PR objective of fixing and removing 'temp_off' from this rule.

Let's verify that this is the only occurrence of 'temp_off' for this rule in the file:

✅ Verification successful

Verification successful: No remaining 'temp_off' attributes found

The default="temp_off" attribute has been successfully removed from the rule PARA_NADA_DESNECESSARIAMENTE. No remaining instances of temp_off are present in languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/style.xml.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining 'temp_off' attributes for the PARA_NADA_DESNECESSARIAMENTE rule

rg --type xml 'id=.PARA_NADA_DESNECESSARIAMENTE.*temp_off' languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/style.xml

Length of output: 148

@marcoagpinto
Copy link
Member Author

@susanaboatto

You were right, let me move it to pt-PT:
Screenshot 2024-10-02 at 07-01-21 Significado de desnecessariamente

@marcoagpinto
Copy link
Member Author

@susanaboatto

Done!

I have just moved it from [pt] to [pt-PT].

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.

1 participant