Skip to content

Commit

Permalink
🏗️ Splits PSM1, Removes #Requires from PSM1
Browse files Browse the repository at this point in the history
Tests were failing because the module was not importable. The `#Requires` syntax being used in the root PSM1 prevented dependencies from being fully resolved before the module loading could complete, making the module unusable.
  • Loading branch information
brucificus committed Dec 18, 2024
1 parent a5d84b0 commit a8146fc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 13 additions & 0 deletions src/poshy-wrap-pylint.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env pwsh
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
#Requires -Modules @{ ModuleName = "poshy-lucidity"; RequiredVersion = "0.4.1" }


function Invoke-PylintReportsDisabled {
pylint --reports=n @args
}
Set-Alias -Name pylint-quick -Value Invoke-PylintReportsDisabled


Export-ModuleMember -Function * -Alias *
13 changes: 3 additions & 10 deletions src/poshy-wrap-pylint.psm1
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
#!/usr/bin/env pwsh
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
#Requires -Modules @{ ModuleName = "poshy-lucidity"; RequiredVersion = "0.4.1" }


if (-not (Test-Command pylint) -and (-not (Get-Variable -Name PWSHRC_FORCE_MODULES_EXPORT_UNSUPPORTED -Scope Global -ValueOnly -ErrorAction SilentlyContinue))) {
if (-not (Get-Command pylint -ErrorAction SilentlyContinue) -and (-not (Get-Variable -Name PWSHRC_FORCE_MODULES_EXPORT_UNSUPPORTED -Scope Global -ValueOnly -ErrorAction SilentlyContinue))) {
return
} else {
. "$PSScriptRoot/poshy-wrap-pylint.ps1"
}

function Invoke-PylintReportsDisabled {
pylint --reports=n @args
}
Set-Alias -Name pylint-quick -Value Invoke-PylintReportsDisabled


Export-ModuleMember -Function * -Alias *

0 comments on commit a8146fc

Please sign in to comment.