Skip to content

🩹 [Patch]: Remove initialization step and dependency on Utilities #114

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 11 commits into from
Jun 1, 2025

Conversation

MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Jun 1, 2025

Description

This pull request simplifies the codebase by removing redundant module dependencies and improving code readability across various scripts. It also consolidates file exclusions in the .jscpd.json configuration and updates logic for handling module manifest properties.

Module Dependency Removal:

  • Removed #Requires statements for unused module dependencies (GitHub, Utilities, Hashtable) across multiple scripts, including Build-PSModule.ps1, Build-PSModuleManifest.ps1, and Build-PSModuleRootModule.ps1 files. [1] [2] [3] [4]

Configuration Updates:

  • Consolidated file exclusions in .github/linters/.jscpd.json by replacing specific file paths with a wildcard (**/scripts/helpers/**).

Workflow Simplification:

  • Removed the Initialize-PSModule step from the Action-Test.yml workflow, streamlining the setup process. [1] [2] [3]

Code Readability Improvements:

  • Replaced custom IsNotNullOrEmpty function calls with native .NET methods like [string]::IsNullOrEmpty for better clarity and maintainability in scripts such as Build-PSModuleManifest.ps1 and Get-PSModuleAliasesToExport.ps1. [1] [2] [3] [4]

Suppression Attribute Adjustments:

  • Updated Diagnostics.CodeAnalysis.SuppressMessageAttribute to include Scope = 'Function' for consistency in scripts like Get-PSModuleClassesToExport.ps1 and Get-PSModuleCmdletsToExport.ps1. [1] [2]

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@Copilot Copilot AI review requested due to automatic review settings June 1, 2025 21:22
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner June 1, 2025 21:22
Copy link
Contributor

@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 PR removes the dependency on the Utilities module and the initialization step from the project, simplifying the code and workflows.

  • Removed the "#Requires -Modules Utilities" line from scripts/main.ps1 to drop the Utilities dependency.
  • Removed the "Initialize environment" step from multiple jobs in the Action-Test workflow.

Reviewed Changes

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

File Description
scripts/main.ps1 Removed the dependency on the Utilities module.
.github/workflows/Action-Test.yml Removed the initialization step from the GitHub Actions workflow.
Comments suppressed due to low confidence (2)

scripts/main.ps1:7

  • Ensure that all functionality previously provided by the Utilities module has been removed or replaced to prevent runtime issues.
#Requires -Modules Utilities

.github/workflows/Action-Test.yml:25

  • Verify that the removal of the 'Initialize environment' step does not impact the workflow execution, and that any required setup is handled elsewhere.
-      - name: Initialize environment

@MariusStorhaug MariusStorhaug self-assigned this Jun 1, 2025
@MariusStorhaug MariusStorhaug merged commit 0d98e7d into main Jun 1, 2025
15 checks passed
@MariusStorhaug MariusStorhaug deleted the removeInit branch June 1, 2025 23:31
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in PSModule Framework Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

1 participant