Exemplo n.º 1
0
def result(scope="module"):
    result = ResultSummary('/fake/root')
    containers = (
        Issue(linter="foo", path="a/b/c.txt", message="oh no foo", lineno=1),
        Issue(
            linter="bar",
            path="d/e/f.txt",
            message="oh no bar",
            hint="try baz instead",
            level="warning",
            lineno="4",
            column="2",
            rule="bar-not-allowed",
        ),
        Issue(
            linter="baz",
            path="a/b/c.txt",
            message="oh no baz",
            lineno=4,
            column=10,
            source="if baz:",
        ),
        Issue(
            linter="foo-diff",
            path="a/b/c.txt",
            message="oh no foo-diff",
            lineno=5,
            source="if baz:",
            diff="diff 1\n- hello\n+ hello2",
        ),
    )
    result = ResultSummary('/fake/root')
    for c in containers:
        result.issues[c.path].append(c)
    return result
Exemplo n.º 2
0
def result(scope='module'):
    containers = (
        Issue(
            linter='foo',
            path='a/b/c.txt',
            message="oh no foo",
            lineno=1,
        ),
        Issue(
            linter='bar',
            path='d/e/f.txt',
            message="oh no bar",
            hint="try baz instead",
            level='warning',
            lineno=4,
            column=2,
            rule="bar-not-allowed",
        ),
        Issue(
            linter='baz',
            path='a/b/c.txt',
            message="oh no baz",
            lineno=4,
            column=10,
            source="if baz:",
        ),
    )
    result = ResultSummary()
    for c in containers:
        result.issues[c.path].append(c)
    return result
Exemplo n.º 3
0
def result():
    result = ResultSummary()
    result.issues['foo.py'].extend([
        Issue(
            linter='no-foobar',
            path='foo.py',
            lineno=1,
            message="Oh no!",
        ),
        Issue(
            linter='no-foobar',
            path='foo.py',
            lineno=3,
            column=10,
            message="To Yuma!",
        ),
    ])
    return result
Exemplo n.º 4
0
def result():
    result = ResultSummary("/fake/root")
    result.issues["foo.py"].extend([
        Issue(
            linter="no-foobar",
            path="foo.py",
            lineno=1,
            message="Oh no!",
        ),
        Issue(
            linter="no-foobar",
            path="foo.py",
            lineno=3,
            column=10,
            message="To Yuma!",
        ),
    ])
    return result
Exemplo n.º 5
0
def fake_run_worker(config, paths, **lintargs):
    result = ResultSummary()
    result.issues['count'].append(1)
    return result
Exemplo n.º 6
0
def fake_run_worker(config, paths, **lintargs):
    result = ResultSummary(lintargs["root"])
    result.issues["count"].append(1)
    return result