Skip to main content

Supported data format

info

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

formatfile_typefile extensionsparser
CSVcsv.csvencoding/csv
HCL 2hcl2.hcltmccombs/hcl2json
JSONjson.jsonencoding/json
TOMLtoml.tomlBurntSushi/toml
TSVtsv.tsvencoding/csv
YAMLyaml.yml, .yamlgopkg.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.