def check_source_file(file, component):
    with open(file, 'r+', encoding='utf8') as f:
        lines = f.readlines()
        header = check_glm_header(lines, file)
        if header:
            print(file, '\t', 'Illegal glm header include', header)
        core_dependency = check_core_dependency(lines, component)
        if core_dependency:
            print(file, '\tWrong core dependency', core_dependency)
        end_of_line = check_end_of_line(lines)
        if end_of_line:
            print(file, '\t', 'Last line does not contain a newline character: ', end_of_line)
            return
        copyright = check_copyright(lines)
        if copyright:
            print(file, '\t', 'Copyright check failed', '\t', copyright)
        bom = check_byte_order_mark_character(lines)
        if bom:
            print(file, '\t', 'Byte order mark failed:', bom)
        empty_only_lines = check_empty_only_line(lines)
        if empty_only_lines:
            print(file, '\t', 'Empty only line: ', empty_only_lines)
        line_length = check_line_length(lines)
        if line_length:
            print(file, '\t', 'Line length exceeded: ', line_length)
        empty_character_at_end = check_empty_character_at_end(lines)
        if empty_character_at_end:
            print(file, '\t', 'Empty character at end: ', empty_character_at_end)
        assert_usage = check_assert_usage(lines)
        if assert_usage:
            print(file, '\t', 'Wrong assert usage: ', assert_usage)
        tabs = check_for_tab(lines)
        if tabs:
            print(file, '\t', 'TABs found: ', tabs)
def check_source_file(file, component):
    with open(file, 'r+', encoding='utf8') as f:
        lines = f.readlines()
        header = check_glm_header(lines, file)
        if header:
            print(file, '\t', 'Illegal glm header include', header)
        core_dependency = check_core_dependency(lines, component)
        if core_dependency:
            print(file, '\tWrong core dependency', core_dependency)
        end_of_line = check_end_of_line(lines)
        if end_of_line:
            print(file, '\t', 'Last line does not contain a newline character: ', end_of_line)
            return
        copyright = check_copyright(lines)
        if copyright:
            print(file, '\t', 'Copyright check failed', '\t', copyright)
        bom = check_byte_order_mark_character(lines)
        if bom:
            print(file, '\t', 'Byte order mark failed:', bom)
        empty_only_lines = check_empty_only_line(lines)
        if empty_only_lines:
            print(file, '\t', 'Empty only line: ', empty_only_lines)
        line_length = check_line_length(lines)
        if line_length:
            print(file, '\t', 'Line length exceeded: ', line_length)
        empty_character_at_end = check_empty_character_at_end(lines)
        if empty_character_at_end:
            print(file, '\t', 'Empty character at end: ', empty_character_at_end)
        assert_usage = check_assert_usage(lines)
        if assert_usage:
            print(file, '\t', 'Wrong assert usage: ', assert_usage)
        tabs = check_for_tab(lines)
        if tabs:
            print(file, '\t', 'TABs found: ', tabs)