From 4ae5487e3ed035c917ab292720f8f370499cb8f6 Mon Sep 17 00:00:00 2001 From: QuentinN42 Date: Thu, 10 Feb 2022 13:16:51 +0100 Subject: [PATCH] feat: add the possibility to pass the level as argument --- yamllint/linter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yamllint/linter.py b/yamllint/linter.py index 0fe2e0c..c4b8bf4 100644 --- a/yamllint/linter.py +++ b/yamllint/linter.py @@ -33,7 +33,7 @@ PROBLEM_LEVELS = { class LintProblem(object): """Represents a linting problem found by yamllint.""" - def __init__(self, line, column, desc='', rule=None): + def __init__(self, line, column, desc='', rule=None, level=None): #: Line on which the problem was found (starting at 1) self.line = line #: Column on which the problem was found (starting at 1) @@ -42,7 +42,7 @@ class LintProblem(object): self.desc = desc #: Identifier of the rule that detected the problem self.rule = rule - self.level = None + self.level = level @property def message(self):