feat: запрет использования ложных категорий в ВызватьИсключение (#1935)#4101
Conversation
📝 WalkthroughWalkthroughThis PR adds a complete ChangesBadExceptionCategory Diagnostic
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/BadExceptionCategoryDiagnosticTest.java (1)
37-37: ⚡ Quick winUse a descriptive test method name instead of
test.Rename this method to reflect behavior under test (for example,
shouldReportForbiddenExceptionCategories) so failures are self-explanatory.Suggested rename
- void test() { + void shouldReportForbiddenExceptionCategories() {As per coding guidelines, "Use meaningful, descriptive names following Java naming conventions; keep class and method names concise but clear".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/BadExceptionCategoryDiagnosticTest.java` at line 37, The test method named test in class BadExceptionCategoryDiagnosticTest is non-descriptive; rename the method to a meaningful name like shouldReportForbiddenExceptionCategories (or another name reflecting the behavior under test) and update the method declaration (keeping any `@Test` annotation intact) so test failures and reports are self-explanatory; ensure any internal references to the old method name are updated accordingly.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/BadExceptionCategoryDiagnosticTest.java`:
- Line 37: The test method named test in class
BadExceptionCategoryDiagnosticTest is non-descriptive; rename the method to a
meaningful name like shouldReportForbiddenExceptionCategories (or another name
reflecting the behavior under test) and update the method declaration (keeping
any `@Test` annotation intact) so test failures and reports are self-explanatory;
ensure any internal references to the old method name are updated accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: bea38d68-e746-41b0-927c-0405eee173cd
⛔ Files ignored due to path filters (1)
src/test/resources/diagnostics/BadExceptionCategoryDiagnostic.bslis excluded by!src/test/resources/**
📒 Files selected for processing (8)
docs/diagnostics/BadExceptionCategory.mddocs/en/diagnostics/BadExceptionCategory.mdsrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/BadExceptionCategoryDiagnostic.javasrc/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.jsonsrc/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.jsonsrc/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/BadExceptionCategoryDiagnostic_en.propertiessrc/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/BadExceptionCategoryDiagnostic_ru.propertiessrc/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/BadExceptionCategoryDiagnosticTest.java
|
|
Пока волью, пришли follow up плз |



Описание
Реализована проверка, которая сообщает о нарушении, если во втором параметре оператора ВызватьИсключение передана одна из следующих запрещенных категорий:
Вместо общих групп рекомендуется использовать максимально точные прикладные категории ошибок.
Связанные задачи
Closes #1935
Чеклист
Общие
gradlew precommit)Для диагностик
Дополнительно
Summary by CodeRabbit
New Features
Documentation