Skip to content

Commit

Permalink
🩹 [Patch]: Update linting and git configuration and license year (#308)
Browse files Browse the repository at this point in the history
## 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]>
  • Loading branch information
MariusStorhaug and github-actions[bot] authored Feb 17, 2025
1 parent 58ad447 commit ca15da3
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 32 deletions.
14 changes: 14 additions & 0 deletions .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"threshold": 0,
"reporters": [
"consoleFull"
],
"ignore": [
"**/tests/**",
"**/src/functions/**",
"**/tools/utilities/**",
"**/.github/workflows/Nightly-Run.yml",
"**/.github/workflows/Process-PSModule.yml"
],
"absolute": true
}
18 changes: 9 additions & 9 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
# - https://github.com/DavidAnson/markdownlint

###############
# Rules by ID #
# Rules by id #
###############
MD004: false # Unordered list style
MD004: false # Unordered list style
MD007:
indent: 2 # Unordered list indentation
indent: 2 # Unordered list indentation
MD013:
line_length: 808 # Line length
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
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
blank_lines: false # Error on blank lines
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'
#)
}
5 changes: 2 additions & 3 deletions .github/workflows/Linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:
uses: super-linter/super-linter@latest
env:
GITHUB_TOKEN: ${{ github.token }}
VALIDATE_JSCPD: false
FILTER_REGEX_EXCLUDE: '.*(/examples/|/src/classes/|/tools/).*'
VALIDATE_JSON_PRETTIER: false
VALIDATE_MARKDOWN_PRETTIER: false
VALIDATE_YAML_PRETTIER: false
VALIDATE_GITLEAKS: false
VALIDATE_POWERSHELL: false # Added due to class usage in the project... TypeNotFound
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

*.code-workspace

# Local History for Visual Studio Code
.history/*

# The Powershell build outputs folder
# PSModule framework outputs folder
outputs/*

# .Net build output
bin/
obj/
libs/
10 changes: 7 additions & 3 deletions Coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
<table>
<tr>
<td>Available functions</td>
<td>1015</td>
<td>1019</td>
</tr>
<tr>
<td>Covered functions</td>
<td>160</td>
</tr>
<tr>
<td>Missing functions</td>
<td>855</td>
<td>859</td>
</tr>
<tr>
<td>Coverage</td>
<td>15.76%</td>
<td>15.7%</td>
</tr>
</table>

Expand Down Expand Up @@ -240,6 +240,8 @@
| `/orgs/{org}/rulesets/rule-suites` | | :white_check_mark: | | | |
| `/orgs/{org}/rulesets/rule-suites/{rule_suite_id}` | | :x: | | | |
| `/orgs/{org}/rulesets/{ruleset_id}` | :x: | :white_check_mark: | | | :x: |
| `/orgs/{org}/rulesets/{ruleset_id}/history` | | :x: | | | |
| `/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}` | | :x: | | | |
| `/orgs/{org}/secret-scanning/alerts` | | :x: | | | |
| `/orgs/{org}/security-advisories` | | :x: | | | |
| `/orgs/{org}/security-managers` | | :x: | | | |
Expand Down Expand Up @@ -546,6 +548,8 @@
| `/repos/{owner}/{repo}/rulesets/rule-suites` | | :white_check_mark: | | | |
| `/repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}` | | :white_check_mark: | | | |
| `/repos/{owner}/{repo}/rulesets/{ruleset_id}` | :x: | :white_check_mark: | | | :x: |
| `/repos/{owner}/{repo}/rulesets/{ruleset_id}/history` | | :x: | | | |
| `/repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}` | | :x: | | | |
| `/repos/{owner}/{repo}/secret-scanning/alerts` | | :x: | | | |
| `/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}` | | :x: | :x: | | |
| `/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations` | | :x: | | | |
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 PSModule
Copyright (c) 2025 PSModule

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Connect-GitHubAccount -Token '...'
If you are using a GitHub App, you can use the `Connect-GitHubAccount` command to authenticate using the client ID and private key.

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

Expand Down

0 comments on commit ca15da3

Please sign in to comment.