Skip to content

refactors qodana profile and enables checks #4517

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

Merged
merged 1 commit into from
Apr 25, 2025
Merged

Conversation

arturcic
Copy link
Member

This pull request includes updates to dependencies, refactors for improved code maintainability, enhancements to Qodana configuration, and namespace adjustments to improve project organization.

Dependency Updates:

  • Updated the Qodana GitHub Action to version v2025.1.0 in .github/workflows/qodana_analysis.yml.

Refactoring and Code Simplification:

  • Removed the WorkingDirectory property from the IConverterContext interface and its implementations, simplifying the OutputContext record structure [1] [2] [3].
  • Refactored VersionVariableSerializer to make FromJson a static method, improving usability and clarity.
  • Replaced default interface implementations with explicit property definitions for IIgnoreConfiguration.IsEmpty [1] [2].

Qodana Configuration Enhancements:

  • Renamed .github/workflows/qodana_code_quality.yml to .github/workflows/qodana_analysis.yml and updated references in build/CI.slnx.
  • Adjusted inspection rules in qodana.yaml, including renaming and reorganizing inspection names for better clarity and adding specific file exclusions for certain inspections [1] [2] [3].

Namespace Adjustments:

  • Moved ExecutableHelper from GitVersion.Core.Tests.Helpers to GitVersion.App.Tests.Helpers to align with its usage context and updated references accordingly [1] [2] [3] [4].

Minor Test and Code Improvements:

  • Replaced IEnvironment with TestEnvironment in various test files for consistency and better test isolation [1] [2] [3].
  • Simplified object initialization in tests by replacing interface types with concrete types where appropriate [1] [2].

Updates the qodana analysis workflow file name.
@arturcic arturcic marked this pull request as ready for review April 25, 2025 07:18
@Copilot Copilot AI review requested due to automatic review settings April 25, 2025 07:18
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors several components to improve code maintainability while enhancing Qodana configuration and updating dependency versions. Key changes include:

  • Refactoring the version variable serializer to use a static FromJson method and removing the WorkingDirectory property from the converter context.
  • Updating namespace usage in tests and helper classes to better reflect usage contexts.
  • Enhancing the Qodana configuration by renaming inspections and updating file exclusions, and updating the GitHub Action version.

Reviewed Changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/GitVersion.Output/Serializer/VersionVariableSerializer.cs Changed FromJson to a static method to improve usability.
src/GitVersion.Output/OutputGenerator/OutputContext.cs Removed the WorkingDirectory parameter for a simplified context.
src/GitVersion.Output/GitVersionOutputTool.cs Updated OutputContext instantiation to match the refactored record.
src/GitVersion.Output.Tests/Output/FormatArgumentTests.cs Changed IEnvironment usage to concrete TestEnvironment for consistency.
src/GitVersion.Core/PublicAPI.Shipped.txt Updated public API to reflect the interface changes.
src/GitVersion.Core/OutputVariables/IVersionVariableSerializer.cs Removed FromJson from the interface in line with the new static implementation.
src/GitVersion.Core/Output/IConverterContext.cs Simplified the interface by removing the WorkingDirectory property.
src/GitVersion.Core/Configuration/IIgnoreConfiguration.cs Removed default implementation for IsEmpty for explicit implementation.
Other test and helper files Updated namespace references and dependency injection to use TestEnvironment.
qodana.yaml Renamed and reorganized inspection rules and exclusions for clarity.
.github/workflows/qodana_analysis.yml Updated Qodana GitHub Action to version v2025.1.0.
Files not reviewed (2)
  • build/CI.slnx: Language not supported
  • src/GitVersion.App.Tests/GitVersion.App.Tests.csproj: Language not supported

@arturcic arturcic merged commit 6059864 into main Apr 25, 2025
272 of 273 checks passed
@arturcic arturcic deleted the feature/qodana-fixes branch April 25, 2025 07:19
Copy link
Contributor

mergify bot commented Apr 25, 2025

Thank you @arturcic for your contribution!

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