Skip to content

Commit

Permalink
🩹 [Patch]: Align code and process (#7)
Browse files Browse the repository at this point in the history
## 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
MariusStorhaug authored Mar 28, 2024
1 parent 9b10de9 commit 337e9c6
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 90 deletions.
25 changes: 25 additions & 0 deletions .github/linters/.markdown-lint.yml
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
29 changes: 29 additions & 0 deletions .github/workflows/Linter.yml
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 }}
4 changes: 3 additions & 1 deletion .github/workflows/Process-PSModule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ on:
- labeled

concurrency:
group: ${{ github.workflow }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write
pull-requests: write
statuses: write

jobs:
Process-PSModule:
Expand Down
6 changes: 0 additions & 6 deletions .vscode/extensions.json

This file was deleted.

81 changes: 0 additions & 81 deletions .vscode/settings.json

This file was deleted.

27 changes: 25 additions & 2 deletions tests/PublicIP.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
Describe 'PublicIP' {
[CmdletBinding()]
Param(
# Path to the module to test.
[Parameter()]
[string] $Path
)

Write-Verbose "Path to the module: [$Path]" -Verbose

Describe 'PublicIP' {
Context 'Module' {
It 'The module should be available' {
Get-Module -Name 'PublicIP' -ListAvailable | Should -Not -BeNullOrEmpty
Write-Verbose (Get-Module -Name 'PublicIP' -ListAvailable | Out-String) -Verbose
}
It 'The module should be imported' {
{ Import-Module -Name 'PublicIP' } | Should -Not -Throw
{ Import-Module -Name 'PublicIP' -Verbose -RequiredVersion 999.0.0 -Force } | Should -Not -Throw
}
}

Context 'Get-PublicIP' {
It 'Should return the public IP address' {
$PublicIP = Get-PublicIP
$PublicIP | Should -Not -BeNullOrEmpty
Write-Verbose ($PublicIP | Out-String) -Verbose
}

It 'Should return the public IP address from MyIP' {
$PublicIP = Get-PublicIP -Provider MyIP
$PublicIP | Should -Not -BeNullOrEmpty
Write-Verbose ($PublicIP | Out-String) -Verbose
}
}
}

0 comments on commit 337e9c6

Please sign in to comment.