Skip to content

Conversation

artbear
Copy link
Contributor

@artbear artbear commented Jun 19, 2023

Описание

  • Реализовано правило
  • в класс DiagnosticIgnoranceComputer добавлено вычисление интервалов установки BSLLS-off

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

Closes #3074

Чеклист

Общие

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

Для диагностик

  • Описание диагностики заполнено для обоих языков (присутствуют файлы для обоих языков, для русского заполнено все подробно, перевод на английский можно опустить)

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

@ghost
Copy link

ghost commented Jun 19, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend
@sonarqubecloud
Copy link

@artbear artbear changed the title Правило Отключение проверок всего модуля - DisableAllDiagnostics Правило Отключение проверок всего модуля - DisableAllDiagnostics - ГОТОВО Aug 24, 2023
<!-- Блоки выше заполняются автоматически, не трогать -->
## Описание диагностики
<!-- Описание диагностики заполняется вручную. Необходимо понятным языком описать смысл и схему работу -->
Правило срабатывает на отключение проверки кода всего модуля через специальный комментарий `// BSLLS-off` или `BSLLS-выкл`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Сначала описать проблему и варианты решения, а логику работы описать ниже


private final Map<DiagnosticCode, List<Range<Integer>>> diagnosticIgnorance = new HashMap<>();
private final Map<DiagnosticCode, Deque<Integer>> ignoranceStack = new HashMap<>();
private final List<org.eclipse.lsp4j.Range> ignoreOffList = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это какой-то не тот рендж

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deque<Integer> stack = ignoranceStack.computeIfAbsent(key, s -> new ArrayDeque<>());
stack.push(comment.getLine());

if (ignoreOff.equals(IGNORE_ALL_OFF)){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

отформатировать

}

@Test
void testOnAndOff() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

добавить тесты

  • ТОЛЬКО отключение в начале модуля
  • несколько включений \ отлкючений в модуле

private final Map<DiagnosticCode, List<Range<Integer>>> diagnosticIgnorance = new HashMap<>();
private final Map<DiagnosticCode, Deque<Integer>> ignoranceStack = new HashMap<>();
private final List<org.eclipse.lsp4j.Range> ignoreOffList = new ArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не вижу причин хранить это отдельно. Вся инфа есть в Data классе по ключу DiagnosticCode("all")

@artbear artbear marked this pull request as draft June 4, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants