Skip to content

Commit a37c7ff

Browse files
📝[Enhancement]: Add Linter configuration options to skip linting and set environment variables; update documentation accordingly.
1 parent 276f61e commit a37c7ff

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

.github/workflows/Get-Settings.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ jobs:
230230
}
231231
232232
}
233+
Linter = [pscustomobject]@{
234+
Skip = $settings.Linter.Skip ?? $false
235+
env = $settings.Linter.env ?? @{}
236+
}
233237
}
234238
LogGroup "Final settings" {
235239
switch -Regex ($settingsFile.Extension) {

.github/workflows/workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
Lint-Repository:
100100
name: Lint code base
101101
runs-on: ubuntu-latest
102-
if: github.event_name == 'pull_request' && github.event.pull_request.merged != true && github.event.action != 'closed'
102+
if: github.event_name == 'pull_request' && github.event.pull_request.merged != true && github.event.action != 'closed' && fromJson(needs.Get-Settings.outputs.Settings).Linter.Skip != true
103103
needs:
104104
- Get-Settings
105105
steps:

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ The following settings are available in the settings file:
260260
| `Publish.Module.MinorLabels` | `String` | Labels indicating a minor version bump | `'minor, feature'` |
261261
| `Publish.Module.PatchLabels` | `String` | Labels indicating a patch version bump | `'patch, fix'` |
262262
| `Publish.Module.IgnoreLabels` | `String` | Labels indicating no release | `'NoRelease'` |
263+
| `Linter.Skip` | `Boolean` | Skip repository linting | `false` |
264+
| `Linter.env` | `Object` | Environment variables for super-linter configuration | `{}` |
263265

264266
<details>
265267
<summary>`PSModule.yml` with all defaults</summary>
@@ -328,6 +330,10 @@ Publish:
328330
PatchLabels: 'patch, fix'
329331
IgnoreLabels: 'NoRelease'
330332
333+
Linter:
334+
Skip: false
335+
env: {}
336+
331337
```
332338
</details>
333339

@@ -365,6 +371,31 @@ Build:
365371
Skip: true
366372
```
367373

374+
### Example 3 - Configuring the Repository Linter
375+
376+
This example shows how to configure the repository linter to skip certain validations or disable the linter entirely.
377+
378+
```yaml
379+
# Skip the linter entirely
380+
Linter:
381+
Skip: true
382+
```
383+
384+
```yaml
385+
# Disable specific linter validations
386+
Linter:
387+
env:
388+
VALIDATE_BIOME_FORMAT: false
389+
VALIDATE_BIOME_LINT: false
390+
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
391+
VALIDATE_JSCPD: false
392+
VALIDATE_JSON_PRETTIER: false
393+
VALIDATE_MARKDOWN_PRETTIER: false
394+
VALIDATE_YAML_PRETTIER: false
395+
```
396+
397+
For a complete list of available linter environment variables, see the [super-linter documentation](https://github.com/super-linter/super-linter#environment-variables).
398+
368399
## Specifications and practices
369400

370401
The process is compatible with:

tests/srcWithManifestTestRepo/.github/PSModule.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Test:
1212
Publish:
1313
AutoCleanup: false
1414
Linter:
15+
Skip: true
1516
env:
1617
VALIDATE_BIOME_FORMAT: false
1718
VALIDATE_BIOME_LINT: false

0 commit comments

Comments
 (0)