-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Expose format options to emitters #1838 * Fixes for validation
- Loading branch information
1 parent
8dff96d
commit dfd8351
Showing
56 changed files
with
1,590 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: About emitters | ||
module: 3.0.0 | ||
--- | ||
|
||
# Emitters | ||
|
||
Emitters allows complex structures and files types (formats) to be pre-processed and resulting objects extracted. | ||
Once processed, the resulting objects can be evaluated by rules. | ||
|
||
## Built-in emitters | ||
|
||
PSRule ships with several built-in emitters for common formats, including: | ||
|
||
- YAML (`yaml`) | ||
- JSON (`json`) | ||
- Markdown (`markdown`) | ||
- PowerShell Data (`powershell_data`) | ||
|
||
The following file extensions are configured by default for each format. | ||
|
||
Name | Default file extensions | Configurable | ||
---- | ----------------------- | :----------: | ||
`yaml` | `.yaml`, `.yml` | Yes | ||
`json` | `.json`, `.jsonc`, `.sarif` | Yes | ||
`markdown` | `.md`, `.markdown` | Yes | ||
`powershell_data` | `.psd1` | Yes | ||
|
||
## Custom emitters | ||
|
||
Custom emitters are a planned feature in PSRule v3. | ||
|
||
## Configuring formats | ||
|
||
The file or object types that each emitter processes is configurable by setting the [Format option](PSRule/en-US/about_PSRule_Options.md#format). | ||
This allows custom types and file extensions to be easily added or removed to a compatible emitter. | ||
|
||
For example, many configuration files use JSON but may end with a different file extension. | ||
The extensions that will be processed can be overridden by setting the `format.json.types` key in `ps-rule.yaml`. | ||
To change the file extension to be processed as JSON the following option can be set: | ||
|
||
```yaml | ||
format: | ||
json: | ||
types: | ||
- .json | ||
- .jsonc | ||
- .jsn | ||
``` | ||
### Advanced configuration | ||
Emitters may support additional options or feature flags for configuration. | ||
Set these, by using the [Configuration](PSRule/en-US/about_PSRule_Options.md#configuration) option. | ||
Currently there is no advanced configuration options for built-in emitters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# PSRule configuration for CI of PSRule repo. | ||
# | ||
|
||
# Please see the documentation for all configuration options: | ||
# https://microsoft.github.io/PSRule/ | ||
|
||
repository: | ||
url: https://github.com/microsoft/PSRule | ||
baseRef: main | ||
|
||
output: | ||
culture: | ||
- en-US | ||
|
||
format: | ||
powershell_data: | ||
type: [] | ||
|
||
input: | ||
fileObjects: true | ||
pathIgnore: | ||
- '**' | ||
- '!**/*.cs' | ||
- '!**/*.ps1' | ||
- '!**/*.psd1' | ||
- '!**/*.psm1' | ||
- '*.Designer.cs' |
Oops, something went wrong.