File: development.rst

package info (click to toggle)
yamllint 1.37.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,516 kB
  • sloc: python: 11,407; makefile: 151; sh: 3
file content (19 lines) | stat: -rw-r--r-- 486 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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: