File: check.py

package info (click to toggle)
python-rjsmin 1.2.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,000 kB
  • sloc: javascript: 8,503; python: 2,847; ansic: 821; sh: 63; makefile: 19
file content (45 lines) | stat: -rw-r--r-- 939 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- encoding: ascii -*-
"""
Checking tasks
~~~~~~~~~~~~~~

"""

import invoke as _invoke

from . import clean as _clean


@_invoke.task(_clean.py)
def lint(ctx):
    """ Run pylint """
    pylint = ctx.shell.frompath('pylint')
    if pylint is None:
        raise RuntimeError("pylint not found")

    with ctx.shell.root_dir():
        ctx.run(ctx.c(
            r''' %(pylint)s --rcfile pylintrc %(package)s ''',
            pylint=pylint,
            package=ctx.package
        ), echo=True)


@_invoke.task(_clean.py)
def flake8(ctx):
    """ Run flake8 """
    flake8 = ctx.shell.frompath('flake8')
    if flake8 is None:
        raise RuntimeError("flake8 not found")

    with ctx.shell.root_dir():
        ctx.run(ctx.c(
            r''' %(flake8)s %(package)s.py ''',
            flake8=flake8,
            package=ctx.package
        ), echo=True)


@_invoke.task(lint, flake8, default=True)
def all(ctx):
    """ Run all """