Ejemplo n.º 1
0
    def validate(self, fname):
        """
        Run installed jshint against a file.
        """

        with utils.temp_config_file(self.configuration) as config_fname:
            
            # https://github.com/jshint/node-jshint/

            options = self.extra_options
            if not "--config" in options:
                if self.configuration and self.configuration.strip() != "":
                    # Make sure we don't pass empty config file as jshint seems to choke on it
                    options += " --config '%s'" % config_fname

            # W:100,10:Unused variable'
            # pylint: disable = W0612    

            exitcode, output = utils.shell(self.logger, 'node %s "%s" %s' % (self.get_jshint_bin(), fname, options))

            if "error" in output:
                self.reporter.report_unstructured(self.id, output, fname=fname)
                return False

        return True
Ejemplo n.º 2
0
Archivo: jshint.py Proyecto: osvalr/vvv
    def validate(self, fname):
        """
        Run installed jshint against a file.
        """

        with utils.temp_config_file(self.configuration) as config_fname:

            # https://github.com/jshint/node-jshint/

            options = self.extra_options
            if not "--config" in options:
                if self.configuration and self.configuration.strip() != "":
                    # Make sure we don't pass empty config file as jshint seems to choke on it
                    options += " --config '%s'" % config_fname

            # W:100,10:Unused variable'
            # pylint: disable = W0612

            exitcode, output = utils.shell(
                self.logger,
                'node %s "%s" %s' % (self.get_jshint_bin(), fname, options))

            if "error" in output:
                self.reporter.report_unstructured(self.id, output, fname=fname)
                return False

        return True
Ejemplo n.º 3
0
    def validate(self, fname):
        """
        Run installed pylint validator against a file.
        """

        with utils.temp_config_file(self.pylint_configuration) as config_fname:

            options = self.extra_options
            if not "--rcfile" in options:
                options += " --rcfile=%s" % config_fname

            if self.pylint_command:
                exitcode, output = utils.shell(self.logger, '%s %s "%s"' % (self.pylint_command, options, fname))
            else:
                exitcode, output = self.run_virtualenv_command('pylint %s "%s"' % (options, fname))

        if exitcode == 0:
            return True # Validation ok
        else:
            self.reporter.report_unstructured(self.id, output, fname=fname)
            return False
Ejemplo n.º 4
0
Archivo: pylint.py Proyecto: osvalr/vvv
    def validate(self, fname):
        """
        Run installed pylint validator against a file.
        """

        with utils.temp_config_file(self.pylint_configuration) as config_fname:

            options = self.extra_options
            if not "--rcfile" in options:
                options += " --rcfile=%s" % config_fname

            if self.pylint_command:
                exitcode, output = utils.shell(
                    self.logger,
                    '%s %s "%s"' % (self.pylint_command, options, fname))
            else:
                exitcode, output = self.run_virtualenv_command(
                    'pylint %s "%s"' % (options, fname))

        if exitcode == 0:
            return True  # Validation ok
        else:
            self.reporter.report_unstructured(self.id, output, fname=fname)
            return False