Doc: Document how to use the yamllint Python module

This commit is contained in:
Adrien Vergé 2016-01-22 17:22:04 +01:00
parent 6e9de02eac
commit 237db5aeef
2 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,11 @@
Development
===========
yamllint provides both a script and a Python module. The latter can be used to
write your own linting tools:
.. autoclass:: yamllint.errors.LintProblem
:members:
.. automodule:: yamllint
:members:

View File

@ -16,10 +16,15 @@
class LintProblem(object):
"""Represents a linting problem found by yamllint."""
def __init__(self, line, column, desc='<no description>', rule=None):
#: Line on which the problem was found (starting at 1)
self.line = line
#: Column on which the problem was found (starting at 1)
self.column = column
#: Human-readable description of the problem
self.desc = desc
#: Identifier of the rule that detected the problem
self.rule = rule
self.level = None