Command Line Usage
Curlylint is a CLI tool first and foremost, all of its functionality can be configured via command line flags.
#
Flags--version
#
Show the version and exit.
--verbose
#
Turns on verbose mode. This makes it easier to troubleshoot what configuration is used, and what files are being linted.
--quiet
#
Don’t emit non-error messages to stderr. Errors are still emitted; silence those with 2>/dev/null
.
--parse-only
#
Don’t lint, check for syntax errors and exit.
--print-config
#
Print the configuration for the given file, and exit.
--format
#
Use a specific output format. [default: stylish, options: compact|json|stylish]
--include
#
A regular expression that matches files and directories that should be included on recursive searches. An empty value means all files are included regardless of the name. Use forward slashes for directories on all platforms (Windows, too). Exclusions are calculated first, inclusions later. [default: .(html|jinja|twig)$]
--exclude
#
A regular expression that matches files and directories that should be excluded on recursive searches. An empty value means no paths are excluded. Use forward slashes for directories on all platforms (Windows, too). Exclusions are calculated first, inclusions later. [default: /(.eggs|.git|.hg|.mypy _cache|.nox|.tox|.venv|venv|myvenv|.svn| _build|buck-out|build|dist|coverage_html_report|node_modules)/]
--rule
#
Specify rules, with the syntax --rule 'code: {"json": "value"}'
. Can be provided multiple times to configure multiple rules.
🚧 Note the rules’ values are formatted as JSON. Numbers can be specified as-is, booleans as true/false. Strings must be wrapped in double quotes. Arrays or objects use JSON syntax.
--template-tags
#
Specify additional sets of template tags, with the syntax --template-tags '[["start_tag", "end_tag"]]'
. This is only needed for tags that wrap other markup (like {% block %}<p>Hello!</p>{% endblock %}
), not for single / “void” tags.
🚧 Note the list of lists is formatted as JSON, with each sub-list containing the tags expected to work together as opening/intermediary/closing tags.
--config
#
Read configuration from the provided file.
#
Reading from standard inputPipe the template to curlylint and use a path of -
so curlylint reads from stdin:
The --stdin-filepath
flag can be used to provide a fake path corresponding to the piped template for linting and reporting: