import os
from bids_validator import BIDSValidator


def validate(bids_directory):
    print('- Validate: init started.')
    file_paths = []
    result = []
    validator = BIDSValidator()
    for path, dirs, files in os.walk(bids_directory):
        for filename in files:
            if filename == '.bidsignore':
                continue

            if filename.endswith('_annotations.tsv'):
                continue

            if filename.endswith('_annotations.json'):
                continue

            temp = os.path.join(path, filename)
            file_paths.append(temp[len(bids_directory):len(temp)])
            result.append(validator.is_bids(temp[len(bids_directory):len(temp)]))
            # print(validator.is_bids(temp[len(bids_directory):len(temp)]))

    return file_paths, result

[((9, 16, 9, 31), 'bids_validator.BIDSValidator', 'BIDSValidator', ({}, {}), '()', False, 'from bids_validator import BIDSValidator\n'), ((10, 29, 10, 52), 'os.walk', 'os.walk', ({(10, 37, 10, 51): 'bids_directory'}, {}), '(bids_directory)', False, 'import os\n'), ((21, 19, 21, 47), 'os.path.join', 'os.path.join', ({(21, 32, 21, 36): 'path', (21, 38, 21, 46): 'filename'}, {}), '(path, filename)', False, 'import os\n')]