def lint(self, *runargs, **lintargs): """Run linters.""" from mozlint import cli lintargs['exclude'] = ['obj*'] cli.SEARCH_PATHS.append(here) self._activate_virtualenv() return cli.run(*runargs, **lintargs)
def inner(args=None): args = args or [] args.extend(files) lintargs = vars(parser.parse_args(args)) lintargs["root"] = here lintargs["config_paths"] = [os.path.join(here, "linters")] return cli.run(**lintargs)
def inner(args=None): args = args or [] args.extend(files) lintargs = vars(parser.parse_args(args)) lintargs['root'] = here lintargs['config_paths'] = [os.path.join(here, 'linters')] return cli.run(**lintargs)
def lint(self, *runargs, **lintargs): """Run linters.""" from mozlint import cli lintargs.setdefault('root', self.topsrcdir) lintargs['exclude'] = ['obj*', 'tools/lint/test/files'] cli.SEARCH_PATHS.append(here) self._activate_virtualenv() return cli.run(*runargs, **lintargs)
def lint(self, *runargs, **lintargs): """Run linters.""" self._activate_virtualenv() from mozlint import cli lintargs.setdefault('root', self.topsrcdir) lintargs['exclude'] = get_global_excludes(lintargs['root']) cli.SEARCH_PATHS.append(here) return cli.run(*runargs, **lintargs)
def lint(self, *runargs, **lintargs): """Run linters.""" self._activate_virtualenv() from mozlint import cli, parser lintargs.setdefault('root', self.topsrcdir) lintargs['exclude'] = get_global_excludes(lintargs['root']) cli.SEARCH_PATHS.append(here) parser.GLOBAL_SUPPORT_FILES.append( os.path.join(self.topsrcdir, THIRD_PARTY_PATHS)) return cli.run(*runargs, **lintargs)
def lint(self, *runargs, **lintargs): """Run linters.""" self._activate_virtualenv() from mozlint import cli, parser try: buildargs = {} buildargs['substs'] = copy.deepcopy(dict(self.substs)) buildargs['defines'] = copy.deepcopy(dict(self.defines)) buildargs['topobjdir'] = self.topobjdir lintargs.update(buildargs) except BuildEnvironmentNotFoundException: pass lintargs.setdefault('root', self.topsrcdir) lintargs['exclude'] = get_global_excludes(lintargs['root']) cli.SEARCH_PATHS.append(here) for path in EXCLUSION_FILES: parser.GLOBAL_SUPPORT_FILES.append( os.path.join(self.topsrcdir, path)) return cli.run(*runargs, **lintargs)
def lint(self, *runargs, **lintargs): """Run linters.""" self._activate_virtualenv() from mozlint import cli, parser try: buildargs = {} buildargs["substs"] = copy.deepcopy(dict(self.substs)) buildargs["defines"] = copy.deepcopy(dict(self.defines)) buildargs["topobjdir"] = self.topobjdir lintargs.update(buildargs) except BuildEnvironmentNotFoundException: pass lintargs.setdefault("root", self.topsrcdir) lintargs["exclude"] = get_global_excludes(lintargs["root"]) lintargs["config_paths"].insert(0, here) for path in EXCLUSION_FILES: parser.GLOBAL_SUPPORT_FILES.append( os.path.join(self.topsrcdir, path)) return cli.run(*runargs, **lintargs)
# 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 __future__ import absolute_import import os import sys here = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, os.path.join(os.path.dirname(here), 'mozlint')) from mozlint import cli cli.SEARCH_PATHS.append(os.path.join(here, 'linters')) if __name__ == '__main__': parser = cli.MozlintParser() args = vars(parser.parse_args(sys.argv[1:])) args['root'] = here sys.exit(cli.run(**args))
def inner(args=None): args = args or [] args.extend(files) lintargs = vars(parser.parse_args(args)) lintargs['root'] = here return cli.run(**lintargs)