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

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
  • Loading branch information
MariusStorhaug authored Feb 18, 2025
1 parent f4d65d3 commit ed636ab
Show file tree
Hide file tree
Showing 6 changed files with 583 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 ed636ab

Please sign in to comment.