Skip to content

Commit

Permalink
🩹 [Patch]: Update linter and git configuration and license year (#3)
Browse files Browse the repository at this point in the history
## Description

Linter configuration updates:

*
[`.github/linters/.jscpd.json`](diffhunk://#diff-557094e283c00b23265c1c75872f41c6b1a524a00f0d99dd68ebd22cb63bfdd6R1-R10):
Added a new configuration file for `jscpd` with specific settings for
threshold, reporters, and ignored paths.
*
[`.github/linters/.powershell-psscriptanalyzer.psd1`](diffhunk://#diff-aae69c9d6774628ed181eacf53aee0f38eb6c2f53492cf3a5b7f7bdb6ef43b6aL1-L16):
Updated the `PSScriptAnalyzer` configuration to enable specific rules
and customized settings for PowerShell script analysis.
*
[`.github/workflows/Linter.yml`](diffhunk://#diff-482e65806ed9e4a7320f14964764086b91fed4a28d12e4efde1776472e147e79R30):
Disabled JSON Prettier validation by setting `VALIDATE_JSON_PRETTIER` to
false.

License update:

*
[`LICENSE`](diffhunk://#diff-c693279643b8cd5d248172d9c22cb7cf4ed163a3c98c8a3f69c2717edd3eacb7L3-R3):
Updated the copyright year from 2024 to 2025.

## 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 Feb 18, 2025
1 parent 36757ca commit f6fc363
Show file tree
Hide file tree
Showing 6 changed files with 585 additions and 15 deletions.
10 changes: 10 additions & 0 deletions .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"threshold": 0,
"reporters": [
"consoleFull"
],
"ignore": [
"**/tests/**"
],
"absolute": true
}
67 changes: 53 additions & 14 deletions .github/linters/.powershell-psscriptanalyzer.psd1
Original file line number Diff line number Diff line change
@@ -1,17 +1,56 @@
#Documentation: https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Cmdlets/Invoke-ScriptAnalyzer.md#-settings
@{
#CustomRulePath='path\to\CustomRuleModule.psm1'
#RecurseCustomRulePath='path\of\customrules'
#Severity = @(
# 'Error'
# 'Warning'
#)
#IncludeDefaultRules=${true}
@{
Rules = @{
PSAlignAssignmentStatement = @{
Enable = $true
CheckHashtable = $true
}
PSAvoidLongLines = @{
Enable = $true
MaximumLineLength = 150
}
PSAvoidSemicolonsAsLineTerminators = @{
Enable = $true
}
PSPlaceCloseBrace = @{
Enable = $true
NewLineAfter = $false
IgnoreOneLineBlock = $true
NoEmptyLineBefore = $false
}
PSPlaceOpenBrace = @{
Enable = $true
OnSameLine = $true
NewLineAfter = $true
IgnoreOneLineBlock = $true
}
PSProvideCommentHelp = @{
Enable = $true
ExportedOnly = $false
BlockComment = $true
VSCodeSnippetCorrection = $false
Placement = 'begin'
}
PSUseConsistentIndentation = @{
Enable = $true
IndentationSize = 4
PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
Kind = 'space'
}
PSUseConsistentWhitespace = @{
Enable = $true
CheckInnerBrace = $true
CheckOpenBrace = $true
CheckOpenParen = $true
CheckOperator = $true
CheckPipe = $true
CheckPipeForRedundantWhitespace = $true
CheckSeparator = $true
CheckParameter = $true
IgnoreAssignmentOperatorInsideHashTable = $true
}
}
ExcludeRules = @(
'PSMissingModuleManifestField'
'PSMissingModuleManifestField', # This rule is not applicable until the module is built.
'PSUseToExportFieldsInManifest'
)
#IncludeRules = @(
# 'PSAvoidUsingWriteHost',
# 'MyCustomRuleName'
#)
}
Loading

0 comments on commit f6fc363

Please sign in to comment.