예제 #1
0
파일: jshint.py 프로젝트: akheron/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
예제 #2
0
파일: jshint.py 프로젝트: 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
예제 #3
0
파일: pylint.py 프로젝트: akheron/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
예제 #4
0
파일: pylint.py 프로젝트: 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