def check_header_file(file, component):
    with open(file, 'r+', encoding='utf8') as f:
        lines = f.readlines()
        correctness = check_correctness(lines)
        if correctness:
            print(file, '\t', 'Correctness check failed', '\t', correctness)
            return
        equality = check_equality(lines)
        if equality:
            print(file, '\t', 'Equality check failed', '\t', equality)
            return
        styling = check_styling(lines)
        if styling:
            print(file, '\t', 'Styling check failed', '\t', styling)
            return
        styling_filename = check_styling_filename(lines, file)
        if styling_filename:
            print(file, '\t', 'Filename styling check failed', '\t', styling_filename)
            return
        comment = check_comment(lines)
        if comment:
            print(file, '\t', 'Comment check failed', '\t', comment)
            return
        copyright = check_copyright(lines)
        if copyright:
            print(file, '\t', 'Copyright check failed', '\t', copyright)
            return
        naming_component = check_naming_convention_component(lines, component)
        if naming_component:
            print(file, '\t', 'Naming convention broken', '\t', naming_component)
            return
        naming_subcomponent = check_naming_convention_subcomponent(lines, component, file)
        if naming_subcomponent:
            print(file, '\t', 'Naming convention broken', '\t', naming_subcomponent)
            return
        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
        (duplicates, symbol) = check_duplicates(lines, previousSymbols)
        if (not duplicates):
            print(file, '\t', 'Duplicate include guard', symbol, 'first in', previousSymbols[symbol])
            return
        else:
            previousSymbols[symbol] = file
        header = check_glm_header(lines, file)
        if header:
            print(file, '\t', 'Illegal glm header include', header)
            return
        core_dependency = check_core_dependency(lines, component)
        if core_dependency:
            print(file, '\t', 'Wrong dependency (core depends on module)', core_dependency)
        if (not ('ghoul_gl.h' in file)):
            using_namespaces = check_using_namespace(lines)
            if using_namespaces:
                print(file, '\t', 'Using namespace found in header file')
        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_header_file(file, component):
    with open(file, 'r+', encoding='utf8') as f:
        lines = f.readlines()
        correctness = check_correctness(lines)
        if correctness:
            print(file, '\t', 'Correctness check failed', '\t', correctness)
            return
        equality = check_equality(lines)
        if equality:
            print(file, '\t', 'Equality check failed', '\t', equality)
            return
        styling = check_styling(lines)
        if styling:
            print(file, '\t', 'Styling check failed', '\t', styling)
            return
        styling_filename = check_styling_filename(lines, file)
        if styling_filename:
            print(file, '\t', 'Filename styling check failed', '\t', styling_filename)
            return
        comment = check_comment(lines)
        if comment:
            print(file, '\t', 'Comment check failed', '\t', comment)
            return
        copyright = check_copyright(lines)
        if copyright:
            print(file, '\t', 'Copyright check failed', '\t', copyright)
            return
        naming_component = check_naming_convention_component(lines, component)
        if naming_component:
            print(file, '\t', 'Naming convention broken', '\t', naming_component)
            return
        naming_subcomponent = check_naming_convention_subcomponent(lines, component, file)
        if naming_subcomponent:
            print(file, '\t', 'Naming convention broken', '\t', naming_subcomponent)
            return
        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
        (duplicates, symbol) = check_duplicates(lines, previousSymbols)
        if (not duplicates):
            print(file, '\t', 'Duplicate include guard', symbol, 'first in', previousSymbols[symbol])
            return
        else:
            previousSymbols[symbol] = file
        header = check_glm_header(lines, file)
        if header:
            print(file, '\t', 'Illegal glm header include', header)
            return
        core_dependency = check_core_dependency(lines, component)
        if core_dependency:
            print(file, '\t', 'Wrong dependency (core depends on module)', core_dependency)
        if (not ('ghoul_gl.h' in file)):
            using_namespaces = check_using_namespace(lines)
            if using_namespaces:
                print(file, '\t', 'Using namespace found in header file')
        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)