-
Notifications
You must be signed in to change notification settings - Fork 109
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
Правило Отключение проверок всего модуля - DisableAllDiagnostics - ГОТОВО #3075
base: develop
Are you sure you want to change the base?
Conversation
Kudos, SonarCloud Quality Gate passed! |
<!-- Блоки выше заполняются автоматически, не трогать --> | ||
## Описание диагностики | ||
<!-- Описание диагностики заполняется вручную. Необходимо понятным языком описать смысл и схему работу --> | ||
Правило срабатывает на отключение проверки кода всего модуля через специальный комментарий `// BSLLS-off` или `BSLLS-выкл` |
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.
Сначала описать проблему и варианты решения, а логику работы описать ниже
@@ -74,6 +76,7 @@ public class DiagnosticIgnoranceComputer implements Computer<DiagnosticIgnorance | |||
|
|||
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<>(); |
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.
это какой-то не тот рендж
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.
@artbear up
@@ -197,6 +198,10 @@ private DiagnosticCode checkIgnoreOff( | |||
Deque<Integer> stack = ignoranceStack.computeIfAbsent(key, s -> new ArrayDeque<>()); | |||
stack.push(comment.getLine()); | |||
|
|||
if (ignoreOff.equals(IGNORE_ALL_OFF)){ |
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.
отформатировать
} | ||
|
||
@Test | ||
void testOnAndOff() { |
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.
добавить тесты
- ТОЛЬКО отключение в начале модуля
- несколько включений \ отлкючений в модуле
@@ -74,6 +76,7 @@ public class DiagnosticIgnoranceComputer implements Computer<DiagnosticIgnorance | |||
|
|||
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<>(); |
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.
Не вижу причин хранить это отдельно. Вся инфа есть в Data классе по ключу DiagnosticCode("all")
Описание
Связанные задачи
Closes #3074
Чеклист
Общие
gradlew precommit
)Для диагностик
Дополнительно