mirror of
https://github.com/adrienverge/yamllint.git
synced 2024-11-23 16:16:23 -06:00
8513d9b97d
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
20 lines
486 B
ReStructuredText
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:
|