-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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-PT] Added APs for language markup on rule ID:BARBARISMS_PT_PT_V3 #11106
Conversation
WalkthroughThe pull request introduces significant modifications to the Changes
Possibly related PRs
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 (1)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/pt-PT/style.xml (1)
369-382
: Consider adding support for additional markup styles.While the current antipatterns handle asterisks and underscores, consider adding support for other common markup styles like backticks (
word
) or double tildes (word) that are used in various documentation formats.<antipattern> <token regexp='yes'>[`]</token> <token regexp='yes' spacebefore='no'>(?:&barbarismos;|&barbarismos_rev2;|&barbarismos_rev3;)s?</token> <token regexp='yes' spacebefore='no'>[`]</token> </antipattern> <antipattern> <token regexp='yes'>[~]{2}</token> <token regexp='yes' spacebefore='no'>(?:&barbarismos;|&barbarismos_rev2;|&barbarismos_rev3;)s?</token> <token regexp='yes' spacebefore='no'>[~]{2}</token> </antipattern>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/pt-PT/style.xml
(1 hunks)
🔇 Additional comments (3)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/pt-PT/style.xml (3)
369-374
: LGTM! Well-structured antipattern for handling asterisk-wrapped foreign words.
The antipattern correctly excludes foreign words that are wrapped in asterisks (word), which is a common way to highlight such terms in technical writing.
376-381
: LGTM! Well-structured antipattern for handling underscore-wrapped foreign words.
The antipattern correctly excludes foreign words that are wrapped in underscores (word), which is another common way to highlight such terms in technical writing.
369-382
: Verify the antipattern behavior with mixed markup styles.
Let's verify that the antipatterns work correctly with mixed markup styles and don't interfere with other rules.
✅ Verification successful
Based on the search results, I can now generate the final response since I have enough information to verify the antipattern behavior:
The antipatterns for marked-up foreign words are safe to add.
The codebase search shows no conflicting rules that handle markup characters (*
, _
) in a way that would interfere with these antipatterns. The antipatterns are specifically designed to handle marked-up foreign words (like *bullying*
and _bullying_
) and prevent false positives when these words are properly marked up in documentation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for potential conflicts with mixed markup styles
# and verify the antipattern behavior
# Test: Search for instances where foreign words are marked up with different styles
# Expect: No false positives when foreign words are properly marked up
rg -A 2 '\*\w+\*|_\w+_|`\w+`|~~\w+~~'
# Test: Search for potential conflicts with other rules that might handle markup
ast-grep --pattern $'rule {
$$$
<token regexp="yes">[*_`~]</token>
$$$
}'
Length of output: 65691
There was a problem hiding this 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 (3)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/pt-PT/style.xml (3)
369-381
: LGTM with a minor suggestion for improvement!The new antipatterns for handling markdown-style formatting of barbarisms are well-structured. Consider combining the two similar antipatterns into one using a character class:
- <token regexp='yes'>[*]</token> + <token regexp='yes'>[*_]</token>This would make the code more maintainable while preserving the same functionality.
468-469
: Consider ordering the suggestions by preference.The new markdown formatting suggestions provide good flexibility. Consider ordering them by preference, with the most recommended format first:
- <suggestion>*\1*</suggestion> - <suggestion>_\1_</suggestion> + <suggestion>_\1_</suggestion> <!-- Underscores are more readable --> + <suggestion>*\1*</suggestion>
471-472
: Consider making the examples more concise.The examples effectively demonstrate all formatting options. Consider making them more concise by using a shorter word:
- <example correction=''software'|"software"|*software*|_software_'>O <marker>software</marker> é poderoso.</example> - <example correction=''softwares'|"softwares"|*softwares*|_softwares_'>Os <marker>softwares</marker> são poderosos.</example> + <example correction=''app'|"app"|*app*|_app_'>O <marker>app</marker> é útil.</example> + <example correction=''apps'|"apps"|*apps*|_apps_'>Os <marker>apps</marker> são úteis.</example>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
languagetool-language-modules/pt/src/main/resources/org/languagetool/rules/pt/pt-PT/style.xml
(2 hunks)
Summary by CodeRabbit