feat: add the possibility to pass the level as argument

This commit is contained in:
QuentinN42
2022-02-10 13:16:51 +01:00
parent d666308eb6
commit 4ae5487e3e

View File

@@ -33,7 +33,7 @@ PROBLEM_LEVELS = {
class LintProblem(object): class LintProblem(object):
"""Represents a linting problem found by yamllint.""" """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, level=None):
#: Line on which the problem was found (starting at 1) #: 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) #: Column on which the problem was found (starting at 1)
@@ -42,7 +42,7 @@ class LintProblem(object):
self.desc = desc self.desc = desc
#: Identifier of the rule that detected the problem #: Identifier of the rule that detected the problem
self.rule = rule self.rule = rule
self.level = None self.level = level
@property @property
def message(self): def message(self):