PSRule
PSRule copied to clipboard
Simplify handling of inputs from files
Currently input from files is processed in two ways:
- As object by using
-Format Detector specific formats such asJson,Yaml, etc...- This option reads objects from supported file formats.
- As file by using
-Format File. - This option treats files as objects themselves. It doesn't inspect the contents of the files directly however because the file objects are passed through the pipeline conventions can perform additional processing on each file to read or expands objects found within each file.
- This option also emits repository information as an object.
- This option also observes
.gitignoreandInput.PathIgnoreoptions. - Files as objects often generate not processed warnings since repositories may not contain any rules that handle file objects directly.
How these options is often a source of confusion and they are not compatible which each other.
We should consolidate these two options into a single input discovery process that is flexible to address the benefits of each method.
Note: Also this should avoid unnecessary warnings that are generated about unprocessed files.
The new discovery process might look like this.
- Scan for input files based on input path.
- Apply filters:
- Exclude
.gitignorepath specs. - Exclude
Input.PathIgnorepath specs. - Custom filtering.
- Exclude
- Apply expansion:
- Built-in expansion of supported file types.
- Custom expansion.