Skip to content

Commit ed636ab

Browse files
🩹 [Patch]: Update linter and git configuration and license year (#3)
## Description This pull request includes several changes to the configuration files for linters and a minor update to the license file. ### Linter Configuration Updates: * Added a new configuration file for `jscpd` to set a threshold of 0, specify the reporter as `consoleFull`, and ignore test files. (`.github/linters/.jscpd.json`) * Updated the `PSScriptAnalyzer` configuration to enable specific rules and set their parameters, including alignment, line length, semicolon usage, brace placement, and whitespace consistency. (`.github/linters/.powershell-psscriptanalyzer.psd1`) * Modified the `Linter.yml` workflow to disable JSON Prettier validation. (`.github/workflows/Linter.yml`) ### License Update: * Updated the copyright year in the `LICENSE` file from 2024 to 2025. (`LICENSE`) ## 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
1 parent f4d65d3 commit ed636ab

File tree

6 files changed

+583
-15
lines changed

6 files changed

+583
-15
lines changed

.github/linters/.jscpd.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"threshold": 0,
3+
"reporters": [
4+
"consoleFull"
5+
],
6+
"ignore": [
7+
"**/tests/**"
8+
],
9+
"absolute": true
10+
}
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
}

0 commit comments

Comments
 (0)