Skip to content
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

Диагностика: Запрещенное имя методанных #1850

Merged
merged 4 commits into from
Oct 5, 2021

Conversation

theshadowco
Copy link
Member

@theshadowco theshadowco commented Oct 5, 2021

Описание

Реализована диагностика, обнаруживающая метаданные с именами, использование которых в запросе не рекомендуется стандартом 1С.

Замечания вешаются на первый рендж модуля по приоритету

  • модуль менеджера / модуль менеджера константы
  • модуль объекта
  • модуль сеанса

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

Closes: #1130

Чеклист

Общие

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

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

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

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

private void checkName(String name, MDOReference mdoReference) {
if (FORBIDDEN_NAMES_PATTERN.matcher(name).matches()) {
String mdoRef;
if (serverConfiguration.getLanguage() == Language.RU) {
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 Author

Choose a reason for hiding this comment

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

увы, но так... надо что-то думать с mdoref для печати


@Override
protected void check() {
Ranges.getFirstSignificantTokenRange(documentContext.getTokens())
Copy link
Member

Choose a reason for hiding this comment

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

а такое срабатывание погасится через diagnosticIgnorance?

Copy link
Member Author

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.

надо бы потом отдельно это зачинить как-нибудь

@nixel2007 nixel2007 merged commit 6d7ef0d into develop Oct 5, 2021
@nixel2007 nixel2007 deleted the feature/forbiddenMetadataName branch October 5, 2021 15:43
@sonarcloud
Copy link

sonarcloud bot commented Oct 5, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NEW] [Мета] Объекту присвоено запрещенное имя
2 participants