Skip to content

Commit ca15da3

Browse files
🩹 [Patch]: Update linting and git configuration and license year (#308)
## Description This pull request includes several changes across different configuration files to update linters, modify validation settings, and update documentation. The most important changes are summarized below: ### Linter Configuration Updates: * [`.github/linters/.jscpd.json`](diffhunk://#diff-557094e283c00b23265c1c75872f41c6b1a524a00f0d99dd68ebd22cb63bfdd6R1-R10): Added a new configuration file for `jscpd` with a threshold of 0, console reporting, and ignoring test files. * [`.github/linters/.powershell-psscriptanalyzer.psd1`](diffhunk://#diff-aae69c9d6774628ed181eacf53aee0f38eb6c2f53492cf3a5b7f7bdb6ef43b6aL1-L16): Updated the `PSScriptAnalyzer` settings to enable various rules, including alignment, long lines, semicolon usage, brace placement, comment help, consistent indentation, and whitespace. ### Validation Settings: * [`.github/workflows/Linter.yml`](diffhunk://#diff-482e65806ed9e4a7320f14964764086b91fed4a28d12e4efde1776472e147e79L30-L34): Changed validation settings by disabling `VALIDATE_JSON_PRETTIER` and removing `VALIDATE_GITLEAKS` and `VALIDATE_POWERSHELL`. ### Documentation Updates: * [`Coverage.md`](diffhunk://#diff-dbfc2288d75ec9b5432d4012b7f852336ed6550ea8964dd6227b64b4a38d7777L8-R20): Updated function coverage numbers and added new API endpoint coverage details. [[1]](diffhunk://#diff-dbfc2288d75ec9b5432d4012b7f852336ed6550ea8964dd6227b64b4a38d7777L8-R20) [[2]](diffhunk://#diff-dbfc2288d75ec9b5432d4012b7f852336ed6550ea8964dd6227b64b4a38d7777R243-R244) [[3]](diffhunk://#diff-dbfc2288d75ec9b5432d4012b7f852336ed6550ea8964dd6227b64b4a38d7777R551-R552) * [`LICENSE`](diffhunk://#diff-c693279643b8cd5d248172d9c22cb7cf4ed163a3c98c8a3f69c2717edd3eacb7L3-R3): Updated the copyright year from 2024 to 2025. ### Minor Fixes: * [`.github/linters/.markdown-lint.yml`](diffhunk://#diff-2fd3619d2b7372123257bc21645edb90c24293e66babbc6053033a89e21bab34L9-R17): Corrected the punctuation list format for the `MD026` rule. ## 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 --------- Co-authored-by: github-actions <[email protected]>
1 parent 58ad447 commit ca15da3

File tree

8 files changed

+95
-32
lines changed

8 files changed

+95
-32
lines changed

.github/linters/.jscpd.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"threshold": 0,
3+
"reporters": [
4+
"consoleFull"
5+
],
6+
"ignore": [
7+
"**/tests/**",
8+
"**/src/functions/**",
9+
"**/tools/utilities/**",
10+
"**/.github/workflows/Nightly-Run.yml",
11+
"**/.github/workflows/Process-PSModule.yml"
12+
],
13+
"absolute": true
14+
}

.github/linters/.markdown-lint.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
# - https://github.com/DavidAnson/markdownlint
77

88
###############
9-
# Rules by ID #
9+
# Rules by id #
1010
###############
11-
MD004: false # Unordered list style
11+
MD004: false # Unordered list style
1212
MD007:
13-
indent: 2 # Unordered list indentation
13+
indent: 2 # Unordered list indentation
1414
MD013:
15-
line_length: 808 # Line length
15+
line_length: 808 # Line length
1616
MD026:
17-
punctuation: '.,;:!。,;:' # List of not allowed
18-
MD029: false # Ordered list item prefix
19-
MD033: false # Allow inline HTML
20-
MD036: false # Emphasis used instead of a heading
17+
punctuation: ".,;:!。,;:" # List of not allowed
18+
MD029: false # Ordered list item prefix
19+
MD033: false # Allow inline HTML
20+
MD036: false # Emphasis used instead of a heading
2121

2222
#################
2323
# Rules by tags #
2424
#################
25-
blank_lines: false # Error on blank lines
25+
blank_lines: false # Error on blank lines
Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,56 @@
1-
#Documentation: https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Cmdlets/Invoke-ScriptAnalyzer.md#-settings
2-
@{
3-
#CustomRulePath='path\to\CustomRuleModule.psm1'
4-
#RecurseCustomRulePath='path\of\customrules'
5-
# Severity = @(
6-
# 'Error'
7-
# 'Warning'
8-
# )
9-
#IncludeDefaultRules=${true}
1+
@{
2+
Rules = @{
3+
PSAlignAssignmentStatement = @{
4+
Enable = $true
5+
CheckHashtable = $true
6+
}
7+
PSAvoidLongLines = @{
8+
Enable = $true
9+
MaximumLineLength = 150
10+
}
11+
PSAvoidSemicolonsAsLineTerminators = @{
12+
Enable = $true
13+
}
14+
PSPlaceCloseBrace = @{
15+
Enable = $true
16+
NewLineAfter = $false
17+
IgnoreOneLineBlock = $true
18+
NoEmptyLineBefore = $false
19+
}
20+
PSPlaceOpenBrace = @{
21+
Enable = $true
22+
OnSameLine = $true
23+
NewLineAfter = $true
24+
IgnoreOneLineBlock = $true
25+
}
26+
PSProvideCommentHelp = @{
27+
Enable = $true
28+
ExportedOnly = $false
29+
BlockComment = $true
30+
VSCodeSnippetCorrection = $false
31+
Placement = 'begin'
32+
}
33+
PSUseConsistentIndentation = @{
34+
Enable = $true
35+
IndentationSize = 4
36+
PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
37+
Kind = 'space'
38+
}
39+
PSUseConsistentWhitespace = @{
40+
Enable = $true
41+
CheckInnerBrace = $true
42+
CheckOpenBrace = $true
43+
CheckOpenParen = $true
44+
CheckOperator = $true
45+
CheckPipe = $true
46+
CheckPipeForRedundantWhitespace = $true
47+
CheckSeparator = $true
48+
CheckParameter = $true
49+
IgnoreAssignmentOperatorInsideHashTable = $true
50+
}
51+
}
1052
ExcludeRules = @(
11-
'PSMissingModuleManifestField'
53+
'PSMissingModuleManifestField', # This rule is not applicable until the module is built.
54+
'PSUseToExportFieldsInManifest'
1255
)
13-
#IncludeRules = @(
14-
# 'PSAvoidUsingWriteHost',
15-
# 'MyCustomRuleName'
16-
#)
1756
}

.github/workflows/Linter.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ jobs:
2727
uses: super-linter/super-linter@latest
2828
env:
2929
GITHUB_TOKEN: ${{ github.token }}
30-
VALIDATE_JSCPD: false
30+
FILTER_REGEX_EXCLUDE: '.*(/examples/|/src/classes/|/tools/).*'
31+
VALIDATE_JSON_PRETTIER: false
3132
VALIDATE_MARKDOWN_PRETTIER: false
3233
VALIDATE_YAML_PRETTIER: false
33-
VALIDATE_GITLEAKS: false
34-
VALIDATE_POWERSHELL: false # Added due to class usage in the project... TypeNotFound

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@
44
!.vscode/tasks.json
55
!.vscode/launch.json
66
!.vscode/extensions.json
7+
!.vscode/*.code-snippets
8+
79
*.code-workspace
810

911
# Local History for Visual Studio Code
1012
.history/*
1113

12-
# The Powershell build outputs folder
14+
# PSModule framework outputs folder
1315
outputs/*
16+
17+
# .Net build output
18+
bin/
19+
obj/
20+
libs/

Coverage.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
<table>
66
<tr>
77
<td>Available functions</td>
8-
<td>1015</td>
8+
<td>1019</td>
99
</tr>
1010
<tr>
1111
<td>Covered functions</td>
1212
<td>160</td>
1313
</tr>
1414
<tr>
1515
<td>Missing functions</td>
16-
<td>855</td>
16+
<td>859</td>
1717
</tr>
1818
<tr>
1919
<td>Coverage</td>
20-
<td>15.76%</td>
20+
<td>15.7%</td>
2121
</tr>
2222
</table>
2323

@@ -240,6 +240,8 @@
240240
| `/orgs/{org}/rulesets/rule-suites` | | :white_check_mark: | | | |
241241
| `/orgs/{org}/rulesets/rule-suites/{rule_suite_id}` | | :x: | | | |
242242
| `/orgs/{org}/rulesets/{ruleset_id}` | :x: | :white_check_mark: | | | :x: |
243+
| `/orgs/{org}/rulesets/{ruleset_id}/history` | | :x: | | | |
244+
| `/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}` | | :x: | | | |
243245
| `/orgs/{org}/secret-scanning/alerts` | | :x: | | | |
244246
| `/orgs/{org}/security-advisories` | | :x: | | | |
245247
| `/orgs/{org}/security-managers` | | :x: | | | |
@@ -546,6 +548,8 @@
546548
| `/repos/{owner}/{repo}/rulesets/rule-suites` | | :white_check_mark: | | | |
547549
| `/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}` | | :white_check_mark: | | | |
548550
| `/repos/{owner}/{repo}/rulesets/{ruleset_id}` | :x: | :white_check_mark: | | | :x: |
551+
| `/repos/{owner}/{repo}/rulesets/{ruleset_id}/history` | | :x: | | | |
552+
| `/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}` | | :x: | | | |
549553
| `/repos/{owner}/{repo}/secret-scanning/alerts` | | :x: | | | |
550554
| `/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}` | | :x: | :x: | | |
551555
| `/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations` | | :x: | | | |

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 PSModule
3+
Copyright (c) 2025 PSModule
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Connect-GitHubAccount -Token '...'
148148
If you are using a GitHub App, you can use the `Connect-GitHubAccount` command to authenticate using the client ID and private key.
149149

150150
```powershell
151-
Connect-GitHubAccount -ClientId 'lv123456789' -PrivateKey '-----BEGIN PRIVATE KEY----- ... -----END PRIVATE KEY-----'
151+
Connect-GitHubAccount -ClientId $ClientID -PrivateKey $PrivateKey
152152
✓ Logged in as my-github-app!
153153
```
154154

0 commit comments

Comments
 (0)