def check_files()

in scripts/legacy/check_metadata.py [0:0]


def check_files(root, file_filter, quiet, full, warn=True):
    filecount = 0
    for path, dirs, files in os.walk(root):
        dirs[:] = [d for d in dirs if d not in skip_folders]
        for filename in fnmatch.filter(files, file_filter):
            if filename in do_not_scan:
                if not quiet:
                    print("\nFile: " + filename + ' is skipped')
                continue
            filecount += 1
            errors = []
            file_path = os.path.join(path, filename)
            if not quiet:
                print("\nChecking File: " + file_path)
            with open(file_path) as f:
                s = f.read()
                
                #Check for Deny List words in file
                verify_no_deny_list_words(s, file_path)
                
                #Check for SecretKeys
                character_scan(s, file_path)
                file_name_check(filename, file_path)
                
                # Split file into list of strings separated by space
                words = s.split()

            # Check for mismatched snippet start and end tags.
            snippets = s.split('snippet-')
            errors.append(snippet_start_check(words, file_path))

            if full:
                # Check for optional metadata
                errors.append(snippet_author_check(snippets, warn))
                errors.append(snippet_service_check(snippets, warn))
                errors.append(snippet_description_check(snippets, warn))
                errors.append(snippet_type_check(snippets, warn))
                errors.append(snippet_date_check(snippets, warn))
                errors.append(snippet_keyword_check(snippets, warn))

            if not quiet:
                print(str(len(words)) + " words found.")
            if warn:
                # Filter to only warning messages
                errors = list(filter(None, errors))
                # print out file name, if warnings found
                if len(errors) > 0 and quiet:
                    print("\nChecking File: " + file_path)
                for error in errors:
                    if error:
                        print(error)
    print(str(filecount) + " files scanned in " + root)
    print("")