pkl-linter
is a command-line interface (CLI) tool designed to lint PKL files. It provides options to lint specific
files or by default search for .pkl
files on a provided directory, apply or omit certain rules, and exclude files or
folders based on regular expressions.
pkl-linter <path>
Or if you want to lint specific files:
pkl-linter --files="file1.pkl,file2.pkl"
pkl-linter ./my/path --recursive
To install pkl-linter
, you need to have Go installed on your machine. Then you can use the following command to
install the tool:
go install github.com/yourusername/pkl-linter@latest
--files
,-i
: Specify files to lint. Provide a list of files.--recursive
,-r
: Recursively search for files in the given path.--excludeFolders
,-e
: Exclude folders that match the given regular expressions.--excludeFiles
,-f
: Exclude files that match the given regular expressions.--applyRules
,-a
: Apply only the given rules.--omitRules
,-o
: Omit the given rules.
Use this flag to specify the files you want to lint. This takes a list of files as input.
If this flag is provided, the tool will only lint the files specified and will omit the recursive search and specified path.
pkl-linter --files="file1.pkl,file2.pkl"
Use this flag to recursively search for files in the given path.
pkl-linter ./my/path --recursive
Use this flag to exclude folders that match the given regular expressions.
pkl-linter ./my/path --excludeFolders "test,docs"
Use this flag to exclude files that match the given regular expressions.
pkl-linter ./my/path --excludeFiles ".*_test.pkl,.*_docs.pkl"
Use this flag to apply only the specified rules.
pkl-linter ./my/path --applyRules "rule1,rule2"
Use this flag to omit certain rules.
pkl-linter ./my/path --omitRules "rule3,rule4"
The following rules are available:
ancestor-paths
: Checks if the ancestor paths follow style guide.file-naming
: Checks if the file naming follows style guide.property-spacing
: Checks if the property spacing follows style guide.string-interpolation
: Checks if the string interpolation follows style guide.
This project is licensed under the MIT License.
Contributions are welcome! Please open an issue or submit a pull request for any changes.