Doc: Document how to use the yamllint Python module
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
Development
|
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
|
.. automodule:: yamllint
|
||||||
:members:
|
:members:
|
||||||
|
|||||||
@@ -16,10 +16,15 @@
|
|||||||
|
|
||||||
|
|
||||||
class LintProblem(object):
|
class LintProblem(object):
|
||||||
|
"""Represents a linting problem found by yamllint."""
|
||||||
def __init__(self, line, column, desc='<no description>', rule=None):
|
def __init__(self, line, column, desc='<no description>', rule=None):
|
||||||
|
#: Line on which the problem was found (starting at 1)
|
||||||
self.line = line
|
self.line = line
|
||||||
|
#: Column on which the problem was found (starting at 1)
|
||||||
self.column = column
|
self.column = column
|
||||||
|
#: Human-readable description of the problem
|
||||||
self.desc = desc
|
self.desc = desc
|
||||||
|
#: Identifier of the rule that detected the problem
|
||||||
self.rule = rule
|
self.rule = rule
|
||||||
self.level = None
|
self.level = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user