'Prints the results (i.e. violations) in this file.
Arguments:
options: A list of the following options:
list_files: True to print only file names, and False to print
all violations.
rule_totals: If True include totals by rule.
out: output file'

def print_results(self, options, out):

    if (options['list_files'] is False):
        if options['rule_totals']:
            max_rule_id_len = max((len(rule_id) for rule_id in self.totals_by_rule))
            print('', file=out)
            for rule_id in sorted(self.totals_by_rule.keys()):
                padding = ('    ' * (max_rule_id_len - len(rule_id)))
                print('{}:    {}{}    violations'.format(rule_id, padding, self.totals_by_rule[rule_id]), file=out)
            print('', file=out)
        print('', file=out)
        print('{}    violations    total'.format(self.total_violations), file=out)
