MCPcopy
hub / github.com/powerline/powerline / format_error

Function format_error

powerline/lint/markedjson/error.py:167–186  ·  view source on GitHub ↗
(context=None, context_mark=None, problem=None, problem_mark=None, note=None, indent=0)

Source from the content-addressed store, hash-verified

165
166
167def format_error(context=None, context_mark=None, problem=None, problem_mark=None, note=None, indent=0):
168 lines = []
169 indentstr = ' ' * indent
170 if context is not None:
171 lines.append(indentstr + context)
172 if (
173 context_mark is not None
174 and (
175 problem is None or problem_mark is None
176 or context_mark != problem_mark
177 )
178 ):
179 lines.append(context_mark.to_string(indent=indent))
180 if problem is not None:
181 lines.append(indentstr + problem)
182 if problem_mark is not None:
183 lines.append(problem_mark.to_string(indent=indent))
184 if note is not None:
185 lines.append(indentstr + note)
186 return '\n'.join(lines)
187
188
189class MarkedError(Exception):

Callers 2

echoerrFunction · 0.85
__init__Method · 0.85

Calls 2

to_stringMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected