summaryrefslogtreecommitdiffstats
path: root/comm/tools/lint/mach_commands.py
blob: da503b2016a3caeb5fd29d61f57d7927be86c3e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from mach.decorators import Command


def setup_argument_parser():
    from mozlint import cli

    return cli.MozlintParser()


@Command(
    "commlint",
    category="thunderbird",
    description="Run linters with Thunderbird configurations.",
    parser=setup_argument_parser,
)
def commlint(command_context, paths, extra_args=[], **kwargs):
    kwargs["config_paths"].insert(0, "comm/tools/lint")
    return command_context._mach_context.commands.dispatch(
        "lint", command_context._mach_context, paths=paths, argv=extra_args, **kwargs
    )