From b4e6207e2452ee9448c46df676f83fb238d2e99e Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 16 Feb 2025 15:00:39 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Add=20configurati?= =?UTF-8?q?on=20files=20for=20linters=20and=20update=20.gitignore=20for=20?= =?UTF-8?q?VS=20Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 15 + .github/linters/.jscpd.json | 10 + .github/linters/.markdown-lint.yml | 25 + .../linters/.powershell-psscriptanalyzer.psd1 | 56 ++ .github/linters/.textlintrc | 513 ++++++++++++++++++ .github/workflows/Linter.yml | 4 +- .gitignore | 23 +- LICENSE | 42 +- 8 files changed, 654 insertions(+), 34 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/linters/.jscpd.json create mode 100644 .github/linters/.markdown-lint.yml create mode 100644 .github/linters/.powershell-psscriptanalyzer.psd1 create mode 100644 .github/linters/.textlintrc diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..96c2e0d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ +# Needed for publishing of examples, build worker defaults to core.autocrlf=input. +* text eol=autocrlf + +*.mof text eol=crlf +*.sh text eol=lf +*.svg eol=lf + +# Ensure any exe files are treated as binary +*.exe binary +*.jpg binary +*.xl* binary +*.pfx binary +*.png binary +*.dll binary +*.so binary diff --git a/.github/linters/.jscpd.json b/.github/linters/.jscpd.json new file mode 100644 index 0000000..23970e8 --- /dev/null +++ b/.github/linters/.jscpd.json @@ -0,0 +1,10 @@ +{ + "threshold": 0, + "reporters": [ + "consoleFull" + ], + "ignore": [ + "**/tests/**" + ], + "absolute": true +} diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 0000000..b9ecdfa --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,25 @@ +########################### +## Markdown Linter rules ## +########################### + +# Linter rules doc: +# - https://github.com/DavidAnson/markdownlint + +############### +# Rules by id # +############### +MD004: false # Unordered list style +MD007: + indent: 2 # Unordered list indentation +MD013: + 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 + +################# +# Rules by tags # +################# +blank_lines: false # Error on blank lines diff --git a/.github/linters/.powershell-psscriptanalyzer.psd1 b/.github/linters/.powershell-psscriptanalyzer.psd1 new file mode 100644 index 0000000..09cc3d0 --- /dev/null +++ b/.github/linters/.powershell-psscriptanalyzer.psd1 @@ -0,0 +1,56 @@ +@{ + 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', # This rule is not applicable until the module is built. + 'PSUseToExportFieldsInManifest' + ) +} diff --git a/.github/linters/.textlintrc b/.github/linters/.textlintrc new file mode 100644 index 0000000..db48de8 --- /dev/null +++ b/.github/linters/.textlintrc @@ -0,0 +1,513 @@ +{ + "filters": { + "comments": true + }, + "rules": { + "terminology": { + "defaultTerms": false, + "terms": [ + "Airbnb", + "Android", + "AppleScript", + "AppVeyor", + "AVA", + "BrowserStack", + "Browsersync", + "Codecov", + "CodePen", + "CodeSandbox", + "DefinitelyTyped", + "EditorConfig", + "ESLint", + "GitHub", + "GraphQL", + "GraphiQL", + "iOS", + "JavaScript", + "JetBrains", + "jQuery", + "LinkedIn", + "Lodash", + "MacBook", + "Markdown", + "OpenType", + "PayPal", + "PhpStorm", + "PowerShell", + "PlayStation", + "RubyMine", + "Sass", + "SemVer", + "TypeScript", + "UglifyJS", + "Wasm", + "WebAssembly", + "WebStorm", + "WordPress", + "YouTube", + [ + "Common[ .]js", + "CommonJS" + ], + [ + "JSDocs?", + "JSDoc" + ], + [ + "Node[ .]js", + "Node.js" + ], + [ + "React[ .]js", + "React" + ], + [ + "SauceLabs", + "Sauce Labs" + ], + [ + "StackOverflow", + "Stack Overflow" + ], + [ + "styled ?components", + "styled-components" + ], + [ + "HTTP[ /]2(?:\\.0)?", + "HTTP/2" + ], + [ + "OS X", + "macOS" + ], + [ + "Mac ?OS", + "macOS" + ], + [ + "a npm", + "an npm" + ], + "ECMAScript", + [ + "ES2015", + "ES6" + ], + [ + "ES7", + "ES2016" + ], + "3D", + [ + "3-D", + "3D" + ], + "Ajax", + "API", + "APIs", + "API's", + [ + "(? Date: Sun, 16 Feb 2025 15:06:53 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Fix=20casing=20in?= =?UTF-8?q?=20module=20requirements=20and=20function=20calls=20in=20PowerS?= =?UTF-8?q?hell=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/info.ps1 | 2 +- tests/info.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/info.ps1 b/scripts/info.ps1 index 8efdbf5..8ea2671 100644 --- a/scripts/info.ps1 +++ b/scripts/info.ps1 @@ -1,4 +1,4 @@ -#Requires -Modules GitHub +#Requires -Modules GitHub [CmdletBinding()] param() diff --git a/tests/info.ps1 b/tests/info.ps1 index 450176b..eb099fa 100644 --- a/tests/info.ps1 +++ b/tests/info.ps1 @@ -1,9 +1,9 @@ #Requires -Modules GitHub LogGroup ' - Get-GithubEventData' { - Get-GithubEventData | Format-List + Get-GitHubEventData | Format-List } LogGroup ' - Get-GithubRunnerData' { - Get-GithubRunnerData | Format-List + Get-GitHubRunnerData | Format-List } From 175691ed9f0bde956d1fff32333f34d6df7b5a06 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 16 Feb 2025 15:07:38 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Change=20Write-Ho?= =?UTF-8?q?st=20to=20Write-Output=20for=20consistent=20output=20handling?= =?UTF-8?q?=20in=20outputs.ps1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/outputs.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/outputs.ps1 b/scripts/outputs.ps1 index 280e847..e43142d 100644 --- a/scripts/outputs.ps1 +++ b/scripts/outputs.ps1 @@ -33,7 +33,7 @@ try { } $result | Format-List - Write-Host "Access outputs using `${{ fromJson(steps.$env:GITHUB_ACTION.outputs.result). }}" + Write-Output "Access outputs using `${{ fromJson(steps.$env:GITHUB_ACTION.outputs.result). }}" } $fenceEnd = '┗' + ('━' * ($fenceStart.Length - 2)) + '┛' Write-Output $fenceEnd From 2e43b24ef492620552c1574806f5c302eaf9c883 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 16 Feb 2025 15:28:35 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20jscpd=20?= =?UTF-8?q?configuration=20to=20ignore=20additional=20workflow=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/linters/.jscpd.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/linters/.jscpd.json b/.github/linters/.jscpd.json index 23970e8..9cd4e12 100644 --- a/.github/linters/.jscpd.json +++ b/.github/linters/.jscpd.json @@ -4,7 +4,9 @@ "consoleFull" ], "ignore": [ - "**/tests/**" + "**/tests/**", + "**/.github/workflows/TestWorkflow.yml", + "**/.github/workflows/Action-Test*" ], "absolute": true }