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

Признак диагностики для разрешения размещения ее замечаний на уровне проекта #3223

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

theshadowco
Copy link
Member

@theshadowco theshadowco commented Jan 11, 2024

Описание

  • Реализована возможность указать диагностике признак, что ее замечания могут быть размещены на уровне проекта.
    • диагностикам по метаданным этот признак установил
  • мелкие фиксы

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

Closes #3222

Чеклист

Общие

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

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

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

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

Summary by CodeRabbit

  • Documentation

    • Updated and translated diagnostic descriptions for better clarity in multiple languages.
    • Corrected minor formatting issue in documentation file names.
  • New Features

    • Enhanced diagnostics capabilities with the ability to locate issues within the project scope.
  • Refactor

    • Expanded diagnostic metadata to include additional fields such as type, severity, scope, and more for richer diagnostic information.

Copy link

coderabbitai bot commented Jan 11, 2024

Walkthrough

The recent updates primarily introduce the ability to attach diagnostic remarks at the project level in SonarQube. This feature is useful for noting issues that apply to the configuration as a whole or when it's impossible to pinpoint a specific module or line. The changes include adding a new property to various diagnostic classes, updating documentation, and enhancing the DiagnosticMetadata annotation with additional fields.

Changes

File Path Change Summary
docs/.../DenyIncompleteValues.md Expanded title to specify the application to register measurements.
docs/en/diagnostics/DeprecatedCurrentDate.md Translated diagnostic description from English to Russian.
docs/en/diagnostics/TransferringParametersBetweenClientAndServer.md Updated title and translated description.
docs/en/diagnostics/UsingFindElementByString.md Removed an extra space in the file name.
src/.../bsl/languageserver/diagnostics/*.java Added canLocateOnProject property with true value to several diagnostic classes.
src/.../bsl/languageserver/diagnostics/metadata/DiagnosticInfo.java Added canLocateOnProject method.
src/.../bsl/languageserver/diagnostics/metadata/DiagnosticMetadata.java Expanded the DiagnosticMetadata annotation with new fields.
src/.../bsl/languageserver/diagnostics/metadata/DiagnosticInfoTest.java Added tests for new properties in DiagnosticInfo.

Assessment against linked issues

Objective Addressed Explanation
Support for attaching remarks at the project level in SonarQube (#3222) The addition of the canLocateOnProject property with a value of true in diagnostic classes enables the attachment of remarks at the project level, addressing the issue.

Poem

In the realm of code where bugs do leap,
A rabbit hopped in, no hill too steep.
With a flip and a thump, the project's now sound,
SonarQube's remarks, on the project, are bound.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@ghost
Copy link

ghost commented Jan 11, 2024

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

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 086aad3 and 7c66312.
Files ignored due to filter (2)
  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json
  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json
Files selected for processing (12)
  • docs/diagnostics/DenyIncompleteValues.md (1 hunks)
  • docs/en/diagnostics/DeprecatedCurrentDate.md (1 hunks)
  • docs/en/diagnostics/TransferringParametersBetweenClientAndServer.md (1 hunks)
  • docs/en/diagnostics/UsingFindElementByString.md (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DenyIncompleteValuesDiagnostic.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ForbiddenMetadataNameDiagnostic.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MetadataObjectNameLengthDiagnostic.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SameMetadataObjectAndChildNamesDiagnostic.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ScheduledJobHandlerDiagnostic.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticInfo.java (1 hunks)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticMetadata.java (1 hunks)
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticInfoTest.java (6 hunks)
Files skipped from review due to trivial changes (3)
  • docs/diagnostics/DenyIncompleteValues.md
  • docs/en/diagnostics/UsingFindElementByString.md
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ScheduledJobHandlerDiagnostic.java
Additional comments: 12
docs/en/diagnostics/DeprecatedCurrentDate.md (1)
  • 1-8: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [3-22]

The translation from English to Russian in the documentation is consistent with the provided summary and the examples are correctly formatted.

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DenyIncompleteValuesDiagnostic.java (1)
  • 45-46: The addition of the canLocateOnProject property with a value of true to the DiagnosticMetadata annotation is consistent with the PR objectives and the AI-generated summary.
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticMetadata.java (1)
  • 42-85: The expansion of the DiagnosticMetadata annotation to include new fields such as type, severity, scope, modules, minutesToFix, activatedByDefault, compatibilityMode, tags, and canLocateOnProject is consistent with the PR objectives and the AI-generated summary.
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MetadataObjectNameLengthDiagnostic.java (1)
  • 45-46: The addition of the canLocateOnProject property with a value of true to the DiagnosticMetadata annotation is consistent with the PR objectives and the AI-generated summary.
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/SameMetadataObjectAndChildNamesDiagnostic.java (1)
  • 57-58: The addition of the canLocateOnProject property with a value of true to the DiagnosticMetadata annotation is consistent with the PR objectives and the AI-generated summary.
docs/en/diagnostics/TransferringParametersBetweenClientAndServer.md (2)
  • 1-1: The title change to "Transferring parameters between the client and the server" is more grammatically correct.

  • 3-4: The diagnostic description block has been translated, which aligns with the AI-generated summary.

src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ForbiddenMetadataNameDiagnostic.java (1)
  • 55-56: The addition of the canLocateOnProject property with a value of true to the DiagnosticMetadata annotation is consistent with the PR objectives and the AI-generated summary.
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticInfo.java (1)
  • 197-199: The addition of the new public method canLocateOnProject to the DiagnosticInfo class is consistent with the PR objectives and the AI-generated summary.
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/metadata/DiagnosticInfoTest.java (3)
  • 28-28: The import for ForbiddenMetadataNameDiagnostic is correctly added to support the new test case.

  • 65-89: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [54-70]

The test case for EmptyCodeBlockDiagnostic has been updated with assertions for the canLocateOnProject property, which is set to false. This is consistent with the expected behavior for this diagnostic.

  • 145-157: The new test case for ForbiddenMetadataNameDiagnostic correctly asserts that the canLocateOnProject property is true, which aligns with the changes made in the corresponding diagnostic class.

Copy link

Qodana Community for JVM

17 new problems were found

Inspection name Severity Problems
Statement with empty body 🔶 Warning 5
'@Serial' annotation could be used 🔶 Warning 4
Constant values 🔶 Warning 3
Mismatched query and update of collection 🔶 Warning 2
Class is exposed outside of its visibility scope 🔶 Warning 1
Nullability and data flow problems 🔶 Warning 1
Mismatched read and write of array 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Copy link

sonarcloud bot commented Jan 11, 2024

@theshadowco theshadowco merged commit abfacae into develop Jan 12, 2024
33 checks passed
@theshadowco theshadowco deleted the feature/issOnPrj branch January 12, 2024 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant