'run command'

def run(self):

    if (self.excludes is not None):
        print('Excludes:\n{0}'.format(yaml.dump(self.excludes, default_flow_style=False)))
    config = YamlLintConfig(file=self.config_file)
    has_errors = False
    has_warnings = False
    if (self.format == 'parsable'):
        format_method = Format.parsable
    else:
        format_method = Format.standard_color
    for yaml_file in find_files(os.getcwd(), self.excludes, None, '\\.ya?ml$'):
        first = True
        with open(yaml_file, 'r') as contents:
            for problem in linter.run(contents, config):
                if (first and (self.format != 'parsable')):
                    print('\n{0}:'.format(os.path.relpath(yaml_file)))
                    first = False
                print(format_method(problem, yaml_file))
                if (problem.level == linter.PROBLEM_LEVELS[2]):
                    has_errors = True
                elif (problem.level == linter.PROBLEM_LEVELS[1]):
                    has_warnings = True
    if (has_errors or has_warnings):
        print('yammlint    issues    found')
        raise SystemExit(1)
