yamllint/docs/development.rst
Adrien Vergé 8513d9b97d docs: Import 'yamllint.config' rather than 'yamllint'
Since yamllint version 0.5.2 (in 2016, just after yamllint was created)
this example in documentation doesn't work. Indeed, commit dbbecb5
(which aimed to solve another problem) removed the ability to import
yamllint submodules directly.

This commit makes it clearer inside documentation.

Fixes https://github.com/adrienverge/yamllint/issues/698
2024-11-20 18:27:38 +01:00

20 lines
486 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.config
import yamllint.linter
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: