-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🩹 [Patch]: Align code and process (#6)
## Description 🩹 [Patch]: Align code and process ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ]⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
- Loading branch information
1 parent
dddfd5a
commit 93e427c
Showing
11 changed files
with
132 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
########################### | ||
## Markdown Linter rules ## | ||
########################### | ||
|
||
# Linter rules doc: | ||
# - https://github.com/DavidAnson/markdownlint | ||
|
||
############### | ||
# Rules by id # | ||
############### | ||
MD004: false # Unordered list style | ||
MD007: | ||
indent: 2 # Unordered list indentation | ||
MD013: | ||
line_length: 808 # Line length | ||
MD026: | ||
punctuation: ".,;:!。,;:" # List of not allowed | ||
MD029: false # Ordered list item prefix | ||
MD033: false # Allow inline HTML | ||
MD036: false # Emphasis used instead of a heading | ||
|
||
################# | ||
# Rules by tags # | ||
################# | ||
blank_lines: false # Error on blank lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Linter | ||
|
||
run-name: "Linter - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}" | ||
|
||
on: [pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
packages: read | ||
statuses: write | ||
|
||
jobs: | ||
Lint: | ||
name: Lint code base | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Lint code base | ||
uses: super-linter/super-linter@latest | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#Requires -Modules Fonts | ||
#Requires -Modules Utilities | ||
#Requires -Modules Admin | ||
|
||
function Install-NerdFont { | ||
<# | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
Describe 'NerdFonts' { | ||
[CmdletBinding()] | ||
Param( | ||
# Path to the module to test. | ||
[Parameter()] | ||
[string] $Path | ||
) | ||
|
||
Write-Verbose "Path to the module: [$Path]" -Verbose | ||
|
||
Describe 'NerdFonts' { | ||
Context 'Module' { | ||
It 'The module should be available' { | ||
Get-Module -Name 'NerdFonts' -ListAvailable | Should -Not -BeNullOrEmpty | ||
Write-Verbose (Get-Module -Name 'NerdFonts' -ListAvailable | Out-String) -Verbose | ||
} | ||
It 'The module should be imported' { | ||
{ Import-Module -Name 'NerdFonts' } | Should -Not -Throw | ||
{ Import-Module -Name 'NerdFonts' -Verbose -RequiredVersion 999.0.0 -Force } | Should -Not -Throw | ||
} | ||
} | ||
|
||
Context 'Get-NerdFont' { | ||
It 'Function exists' { | ||
Get-Command Get-NerdFont | Should -Not -BeNullOrEmpty | ||
} | ||
|
||
It 'Returns all fonts' { | ||
$fonts = Get-NerdFont | ||
Write-Verbose ($fonts | Out-String) -Verbose | ||
$fonts | Should -Not -BeNullOrEmpty | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
function Download-NerdFonts { | ||
[CmdletBinding()] | ||
param( | ||
$Path = "$env:TEMP\NerdFonts" | ||
) | ||
# function Download-NerdFonts { | ||
# [CmdletBinding()] | ||
# param( | ||
# $Path = "$env:TEMP\NerdFonts" | ||
# ) | ||
|
||
} | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
function Get-NerdFontsRelease { | ||
[CmdletBinding()] | ||
param( | ||
[Parameter( | ||
ParameterSetName = 'Latest', | ||
Mandatory | ||
)] | ||
[switch] $Latest, | ||
# function Get-NerdFontsRelease { | ||
# [CmdletBinding()] | ||
# param( | ||
# [Parameter( | ||
# ParameterSetName = 'Latest', | ||
# Mandatory | ||
# )] | ||
# [switch] $Latest, | ||
|
||
[Parameter( | ||
ParameterSetName = 'Latest' | ||
)] | ||
[switch] $AllowPrerelease, | ||
# [Parameter( | ||
# ParameterSetName = 'Latest' | ||
# )] | ||
# [switch] $AllowPrerelease, | ||
|
||
[Parameter( | ||
ParameterSetName = 'Version' | ||
)] | ||
[ValidateSet({ Get-NerdFontsVersionList })] | ||
[string] $Version | ||
) | ||
# [Parameter( | ||
# ParameterSetName = 'Version' | ||
# )] | ||
# [ValidateSet({ Get-NerdFontsVersionList })] | ||
# [string] $Version | ||
# ) | ||
|
||
begin { | ||
$versionPattern = [regex]'(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' | ||
} | ||
# begin { | ||
# $versionPattern = [regex]'(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' | ||
# } | ||
|
||
process { | ||
foreach ($TerraformPath in $Path) { | ||
$terraformVersionOutput = & $TerraformPath --version | ||
$version = $versionPattern.Match($terraformVersionOutput).Value | ||
[pscustomobject]@{ | ||
Path = $TerraformPath | ||
Version = $version | ||
} | ||
} | ||
} | ||
# process { | ||
# foreach ($TerraformPath in $Path) { | ||
# $terraformVersionOutput = & $TerraformPath --version | ||
# $version = $versionPattern.Match($terraformVersionOutput).Value | ||
# [pscustomobject]@{ | ||
# Path = $TerraformPath | ||
# Version = $version | ||
# } | ||
# } | ||
# } | ||
|
||
end { | ||
return $versions | ||
} | ||
} | ||
# end { | ||
# return $versions | ||
# } | ||
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
function Get-NerdFontsVersionList { | ||
[OutputType([string[]])] | ||
[CmdletBinding()] | ||
param() | ||
# function Get-NerdFontsVersionList { | ||
# [OutputType([string[]])] | ||
# [CmdletBinding()] | ||
# param() | ||
|
||
$versionPattern = [regex]'(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' | ||
# $versionPattern = [regex]'(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' | ||
|
||
$release = Invoke-RestMethod $script:NerdFontsReleaseURL -Verbose:$false | ||
$versions = $release.tag_name | Where-Object { $_ -match $versionPattern } | Sort-Object | ||
# $release = Invoke-RestMethod $script:NerdFontsReleaseURL -Verbose:$false | ||
# $versions = $release.tag_name | Where-Object { $_ -match $versionPattern } | Sort-Object | ||
|
||
return $versions | ||
} | ||
# return $versions | ||
# } |