Skip to content

Новый тип и изменения в квалификаторах#161

Merged
theshadowco merged 3 commits intodevelopfrom
feature/newEnumElements260220
Feb 20, 2026
Merged

Новый тип и изменения в квалификаторах#161
theshadowco merged 3 commits intodevelopfrom
feature/newEnumElements260220

Conversation

@theshadowco
Copy link
Member

@theshadowco theshadowco commented Feb 20, 2026

Описание

  1. Добавлен новый тип
  2. Длина в квалификаторах стала long

Связанные задачи

Closes:

Чеклист

Общие

  • Ветка PR обновлена из develop
  • Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • Изменения покрыты тестами
  • Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Дополнительно

2. Длина в квалификаторах стала long
@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

Прохождение

Обновление внутреннего представления длины с int на long в квалификаторах BinaryDataQualifiers и StringQualifiers, добавление перегрузок фабричных методов и корректировка сравнения; добавлена новая константа HORIZONTAL_ALIGN в V8ValueType и обновлён соответствующий тест.

Изменения

Когорта / Файл(ы) Сводка
Расширение типов квалификаторов
src/main/java/com/github/_1c_syntax/bsl/types/qualifiers/BinaryDataQualifiers.java, src/main/java/com/github/_1c_syntax/bsl/types/qualifiers/StringQualifiers.java
Поле length изменено с int на long; приватные конструкторы и статические фабричные методы create() обновлены/добавлены перегрузки для long и int (делегирование); сравнение в compareTo переключено на Long.compare().
Новая константа перечисления
src/main/java/com/github/_1c_syntax/bsl/types/value/V8ValueType.java
Добавлена публичная константа HORIZONTAL_ALIGN в перечисление V8ValueType.
Обновление теста
src/test/java/com/github/_1c_syntax/bsl/types/value/V8ValueTypeTest.java
Ожидаемый размер коллекции значений увеличен с hasSize(37) до hasSize(38) в связи с добавлением новой константы.

Оценка затрат на проверку кода

🎯 3 (Moderate) | ⏱️ ~20 минут

Возможно связанные PR

Стихотворение

🐰 Длина теперь на long взлетает,
Фабрики перегрузки ласково шагают,
Горизонтально выстроен новый знак,
Тест подрос счётом — добавлен шаг.
Пусть код прыгает и тесты поют — ура!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed Название кратко описывает основные изменения: добавлен новый тип и изменены квалификаторы, что соответствует содержимому пулл-реквеста.
Description check ✅ Passed PR описание связано с изменениями: добавлен новый тип (HORIZONTAL_ALIGN) и изменена длина квалификаторов с int на long.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/newEnumElements260220

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

🧹 Nitpick comments (1)
src/main/java/com/github/_1c_syntax/bsl/types/value/V8ValueType.java (1)

79-80: Нарушение алфавитного порядка: HORIZONTAL_ALIGN следует разместить перед VERTICAL_ALIGN.

Весь enum выдержан в алфавитном порядке по имени константы, однако HORIZONTAL_ALIGN (H…) помещён после VERTICAL_ALIGN (V…). Если это не намеренная логическая группировка, рекомендуется сохранить единый стиль.

♻️ Предложение: привести к алфавитному порядку
-  VERTICAL_ALIGN("VerticalAlign", "ВертикальноеПоложение"),
-  HORIZONTAL_ALIGN("HorizontalAlign", "ГоризонтальноеПоложение");
+  HORIZONTAL_ALIGN("HorizontalAlign", "ГоризонтальноеПоложение"),
+  VERTICAL_ALIGN("VerticalAlign", "ВертикальноеПоложение");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/github/_1c_syntax/bsl/types/value/V8ValueType.java` around
lines 79 - 80, Enum constant order in V8ValueType is out of alphabetical order:
move the HORIZONTAL_ALIGN enum constant so it appears before VERTICAL_ALIGN to
restore consistent alphabetical ordering; update the enum declaration in
V8ValueType by swapping the positions of HORIZONTAL_ALIGN and VERTICAL_ALIGN
(ensure commas/terminator remain correct after reordering).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/main/java/com/github/_1c_syntax/bsl/types/qualifiers/BinaryDataQualifiers.java`:
- Line 38: The change of the length field to long breaks the public API; restore
source/binary compatibility by keeping the original int-based API: in
BinaryDataQualifiers keep an int length (or add a deprecated int getLength()
that returns (int)length) and add a new accessor getLengthLong() that returns
long; also add an explicit public 3-arg constructor signature matching the old
int parameter (or an explicit factory overload) that delegates to the new
long-based constructor so the Lombok-generated constructor signature remains
available, and ensure existing factory methods create(int) and create(int,
AllowedLength) still delegate correctly to the long-backed implementation; if
you intended to make this breaking change, publish a new major version instead.

In
`@src/main/java/com/github/_1c_syntax/bsl/types/qualifiers/StringQualifiers.java`:
- Around line 72-78: Update the Javadoc in class StringQualifiers for the
string-length qualifier methods: replace the incorrect copied descriptions from
BinaryDataQualifiers so that the `@param` for length reads "Длина строки" (not
"Длина строки base64") and the `@return` reads "Квалификатор строки" (not
"Квалификатор двоичных данных"); apply the same fixes to both the
variable-length and fixed-length factory methods in StringQualifiers so their
parameter and return descriptions correctly refer to strings.

---

Duplicate comments:
In
`@src/main/java/com/github/_1c_syntax/bsl/types/qualifiers/StringQualifiers.java`:
- Line 38: В классе StringQualifiers возврат и поле длины не должны ломать API —
откатить изменение getLength() с long на int и вернуть поле length и
Lombok-генерируемый публичный конструктор к использованию int (как в
BinaryDataQualifiers), либо сохранить новое long-поле под другим именем и
добавить совместимый метод int getLength() (или getLengthInt()) и
соответствующий конструктор/параметр, чтобы существующие вызовы класса
StringQualifiers и его конструктора остались совместимыми.

---

Nitpick comments:
In `@src/main/java/com/github/_1c_syntax/bsl/types/value/V8ValueType.java`:
- Around line 79-80: Enum constant order in V8ValueType is out of alphabetical
order: move the HORIZONTAL_ALIGN enum constant so it appears before
VERTICAL_ALIGN to restore consistent alphabetical ordering; update the enum
declaration in V8ValueType by swapping the positions of HORIZONTAL_ALIGN and
VERTICAL_ALIGN (ensure commas/terminator remain correct after reordering).

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/com/github/_1c_syntax/bsl/types/value/V8ValueType.java (1)

40-80: ⚠️ Potential issue | 🟡 Minor

Выполнение gradlew precommit не подтверждено

В чеклисте PR явно отмечено, что обязательный шаг gradlew precommit не выполнен. Это означает, что форматирование, статический анализ и иные pre-commit проверки могут не пройти при слиянии. Рекомендуется запустить задачу перед мерджем.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/github/_1c_syntax/bsl/types/value/V8ValueType.java` around
lines 40 - 80, The pre-commit checks were not run for this PR; run the project's
precommit task locally (gradlew precommit), fix any formatting/static-analysis
issues it reports (likely in enum V8ValueType in V8ValueType.java), then commit
the resulting changes and push; ensure the enum V8ValueType compiles and passes
all checks before updating the PR.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/main/java/com/github/_1c_syntax/bsl/types/value/V8ValueType.java`:
- Around line 40-80: The pre-commit checks were not run for this PR; run the
project's precommit task locally (gradlew precommit), fix any
formatting/static-analysis issues it reports (likely in enum V8ValueType in
V8ValueType.java), then commit the resulting changes and push; ensure the enum
V8ValueType compiles and passes all checks before updating the PR.

@sonarqubecloud
Copy link

@theshadowco theshadowco merged commit e46684d into develop Feb 20, 2026
16 checks passed
@theshadowco theshadowco deleted the feature/newEnumElements260220 branch February 20, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant