yamllint/docs/development.rst
Okue 06db2af9b0
docs: Fix misleading Python API example
`yamllint.linter.run("example.yaml", yaml_config)` example seems
`yamllint.linter.run` opens a given file.
It's misleading.
2023-01-30 18:04:51 +01:00

19 lines
453 B
ReStructuredText

Development
===========
yamllint provides both a script and a Python module. The latter can be used to
write your own linting tools.
Basic example of running the linter from Python:
.. code-block:: python
import yamllint
yaml_config = yamllint.config.YamlLintConfig("extends: default")
for p in yamllint.linter.run(open("example.yaml", "r"), yaml_config):
print(p.desc, p.line, p.rule)
.. automodule:: yamllint.linter
:members: