Commit fdca4e5
🩹 [Patch]: Linting passes on all platforms (#25)
The `Lint-SourceCode` and `Lint-Module` CI jobs now pass on Linux,
macOS, and Windows. All `PSAvoidLongLines` violations that blocked the
pipeline after PR #18 was merged have been resolved by extracting long
error message strings into local variables and splitting long inline
conditionals across multiple lines.
- Fixes #24
## Fixed: Linting no longer fails on any platform
`PSScriptAnalyzer` reported a `PSAvoidLongLines` violation (line length
> 120 characters) in three source files, causing every platform leg of
both `Lint-SourceCode` and `Lint-Module` to exit with code 1 and
preventing `Get-TestResults` from completing successfully.
The affected lines were all `throw` statements with long interpolated
error messages and one long inline `if/else` expression used to set an
HMAC key. Each has been reformatted — long messages extracted into a
`$message` variable, and the inline conditional split across multiple
lines. No error types, parameter names, function signatures, or
observable behaviors changed.
All 31 Pester tests pass locally after the reformatting.
## Technical Details
- **`New-Jwt.ps1`** — 7 violations fixed: `throw` messages on lines 80,
90, 101, 106, 128, 144 extracted to `$message` variables;
`$hmacsha256.Key = if (...) {...} else {...}` on line 132 split across
multiple lines.
- **`Test-Jwt.ps1`** — 6 violations fixed: same patterns as
`New-Jwt.ps1` (lines 78, 88, 103, 121, 125, 154).
- **`ConvertTo-Base64UrlString.ps1`** — 2 violations fixed: `.NOTES`
comment wrapped at a word boundary (line 24); `throw` message extracted
via an intermediate `$type` variable to stay within 120 chars (line 51).
- **Implementation plan progress**: All tasks completed — source fixes
in all three files applied, `Invoke-ScriptAnalyzer` returns no
`PSAvoidLongLines` results, and all 31 Pester tests pass.
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>1 parent 383e134 commit fdca4e5
3 files changed
Lines changed: 37 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
90 | | - | |
| 91 | + | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | | - | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | | - | |
| 109 | + | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| |||
125 | 129 | | |
126 | 130 | | |
127 | 131 | | |
128 | | - | |
| 132 | + | |
| 133 | + | |
129 | 134 | | |
130 | 135 | | |
131 | 136 | | |
132 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
133 | 142 | | |
134 | 143 | | |
135 | 144 | | |
| |||
141 | 150 | | |
142 | 151 | | |
143 | 152 | | |
144 | | - | |
| 153 | + | |
| 154 | + | |
145 | 155 | | |
146 | 156 | | |
147 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| |||
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
103 | | - | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| |||
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
121 | | - | |
| 124 | + | |
| 125 | + | |
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
125 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
| |||
151 | 159 | | |
152 | 160 | | |
153 | 161 | | |
154 | | - | |
| 162 | + | |
| 163 | + | |
155 | 164 | | |
156 | 165 | | |
157 | 166 | | |
| |||
0 commit comments