Supported data format
If you want to request new data format, please create an issue.
lintnet can lint the following file formats. lintnet judges file types by file extensions. We're considering supporting additional file formats. #37
format | file_type | file extensions | parser |
---|---|---|---|
CSV | csv | .csv | encoding/csv |
HCL 2 | hcl2 | .hcl | tmccombs/hcl2json |
JSON | json | .json | encoding/json |
TOML | toml | .toml | BurntSushi/toml |
TSV | tsv | .tsv | encoding/csv |
YAML | yaml | .yml , .yaml | gopkg.in/yaml.v3 |
YAML is parsed as multiple documents
A YAML file is comprised of multiple documents separated by ---
.
e.g.
---
# document 0
name: foo
---
# document 1
name: bar
So A YAML file is parsed as multiple documents even if the file includes only one document. In lint rules, you need to iterate multiple documents or get the first document by specifying the index.
e.g.
for doc in param.data.value # Iterate multiple documents
param.data.value[0] # Get the first document
Plain Text
lintnet judges file types by file extensions.
If no parser is found, lintnet parse the file as a plain text file.
The external variable file_type
is plain_text
.
The external variable input
is empty, but you can still lint the file with other external variables such as file_path
and file_text
.