Обновленный список правил EDT#420
Conversation
WalkthroughОбновлены ожидаемые значения количества правил в тестовых методах класса Changes
Possibly related PRs
Poem
🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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/sonar/ext_issues/RuleDefinitionTest.java (1)
49-49: Вынесите ожидаемые размеры в именованные константы для упрощения поддержки.Сейчас значения
309и313повторяются в нескольких тестах. Это не ошибка, но константы упростят будущие обновления набора правил.♻️ Вариант рефакторинга
class RuleDefinitionTest { + private static final int DEFAULT_RULES_COUNT = 309; + private static final int EXTERNAL_RULES_COUNT = 313; + private final Reporter reporter = EdtReporter.create(); @@ - assertThat(repository.rules()).hasSize(309); + assertThat(repository.rules()).hasSize(DEFAULT_RULES_COUNT); @@ - assertThat(repository.rules()).hasSize(309); + assertThat(repository.rules()).hasSize(DEFAULT_RULES_COUNT); @@ - assertThat(repository.rules()).hasSize(313); + assertThat(repository.rules()).hasSize(EXTERNAL_RULES_COUNT); @@ - assertThat(repository.rules()).hasSize(309); + assertThat(repository.rules()).hasSize(DEFAULT_RULES_COUNT);Also applies to: 66-66, 89-89, 112-112
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/test/java/com/github/_1c_syntax/bsl/sonar/ext_issues/RuleDefinitionTest.java` at line 49, In RuleDefinitionTest, replace hard-coded numeric literals used in assertions (e.g., assertThat(repository.rules()).hasSize(309) and the occurrences of 313) with named constants defined at the top of the class (for example private static final int EXPECTED_RULES_COUNT_309 = 309 and private static final int EXPECTED_RULES_COUNT_313 = 313 or more descriptive names), then use those constants in all assertions that currently use 309 or 313; update every assertion that calls assertThat(repository.rules()).hasSize(...) to reference the new constants so future updates require changing a single constant in the class.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@src/test/java/com/github/_1c_syntax/bsl/sonar/ext_issues/RuleDefinitionTest.java`:
- Line 49: In RuleDefinitionTest, replace hard-coded numeric literals used in
assertions (e.g., assertThat(repository.rules()).hasSize(309) and the
occurrences of 313) with named constants defined at the top of the class (for
example private static final int EXPECTED_RULES_COUNT_309 = 309 and private
static final int EXPECTED_RULES_COUNT_313 = 313 or more descriptive names), then
use those constants in all assertions that currently use 309 or 313; update
every assertion that calls assertThat(repository.rules()).hasSize(...) to
reference the new constants so future updates require changing a single constant
in the class.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 99d52667-2db3-4e84-ab49-70485e3c4c03
⛔ Files ignored due to path filters (1)
src/main/resources/edt.jsonis excluded by!**/*.json
📒 Files selected for processing (1)
src/test/java/com/github/_1c_syntax/bsl/sonar/ext_issues/RuleDefinitionTest.java
|



No description provided.