pylint/lint.py
def _report_evaluation(self):
        """make the global evaluation report"""
        # check with at least check 1 statements (usually 0 when there is a
        # syntax error preventing pylint from further processing)
        previous_stats = config.load_results(self.file_state.base_name)
        if self.stats["statement"] == 0:
            return

        # get a global note for the code
        evaluation = self.config.evaluation
        try:
            note = eval(evaluation, {}, self.stats)  # pylint: disable=eval-used
        except Exception as ex:
            msg = "An exception occurred while rating: %s" % ex
        else:
            self.stats["global_note"] = note
            msg = "Your code has been rated at %.2f/10" % note
            pnote = previous_stats.get("global_note")
            if pnote is not None:
                msg += " (previous run: %.2f/10, %+.2f)" % (pnote, note - pnote)

        if self.config.score:
            sect = report_nodes.EvaluationSection(msg)
            self.reporter.display_reports(sect)
def _report_evaluation(self):
        # check with at least check 1 statements (usually 0 when there is a
        # syntax error preventing pylint from further processing)
        previous_stats = config.load_results(self.file_state.base_name)
        if self.stats["statement"] == 0:
            return

        # get a global note for the code
        evaluation = self.config.evaluation
        try:
            note = eval(evaluation, {}, self.stats)  # pylint: disable=eval-used
        except Exception as ex:
            msg = "An exception occurred while rating: %s" % ex
        else:
            self.stats["global_note"] = note
            msg = "Your code has been rated at %.2f/10" % note
            pnote = previous_stats.get("global_note")
            if pnote is not None:
                msg += " (previous run: %.2f/10, %+.2f)" % (pnote, note - pnote)

        if self.config.score:
            sect = report_nodes.EvaluationSection(msg)
            self.reporter.display_reports(sect)
def _report_evaluation ( self ) : # check with at least check 1 statements (usually 0 when there is a # syntax error preventing pylint from further processing) previous_stats = config . load_results ( self . file_state . base_name ) if self . stats [ "statement" ] == 0 : return # get a global note for the code evaluation = self . config . evaluation try : note = eval ( evaluation , { } , self . stats ) # pylint: disable=eval-used except Exception as ex : msg = "An exception occurred while rating: %s" % ex else : self . stats [ "global_note" ] = note msg = "Your code has been rated at %.2f/10" % note pnote = previous_stats . get ( "global_note" ) if pnote is not None : msg += " (previous run: %.2f/10, %+.2f)" % ( pnote , note - pnote ) if self . config . score : sect = report_nodes . EvaluationSection ( msg ) self . reporter . display_reports ( sect )
make the global evaluation report
make the global evaluation report