wpiformat/wpiformat/includeorder.py
def classify_header(self, config_file, include_line, file_name):
        """Classify the given header name and return the corresponding index.

        Keyword arguments:
        config_file -- Config object
        include_line -- regex Match object for include line
        file_name -- file name string

        Returns header classification index.
        """
        # Process override regexes
        for idx in range(5):
            if self.override_regexes[idx].search(include_line.group("name")):
                return idx

        include_name = os.path.basename(include_line.group("name"))
        include_base, include_ext = os.path.splitext(include_name)
        file_base, file_ext = os.path.splitext(file_name)

        # Is related if include has same base name as file name and file has a
        # source extension
        include_is_related = include_base == file_base and \
            (config_file.is_c_src_file(file_name) or \
             config_file.is_cpp_src_file(file_name))

        if include_is_related:
            return 0
        elif include_line.group("name") in self.c_std:
            return 1
        elif self.c_sys_regex.search(include_line.group("header")):
            return 1
        elif include_line.group("name") in self.cpp_std:
            return 2
        elif include_line.group("open_bracket") == "<":
            return 3
        elif self.include_is_header(config_file, file_name, include_name):
            return 4
        else:
            return -1
Classify the given header name and return the corresponding index.

        Keyword arguments:
        config_file -- Config object
        include_line -- regex Match object for include line
        file_name -- file name string

        Returns header classification index.
        
Classify the given header name and return the corresponding index.

Returns header classification index.
Classify the given header name and return the corresponding index . Returns header classification index .
def classify_header(self, config_file, include_line, file_name):
        for idx in range(5):
            if self.override_regexes[idx].search(include_line.group("name")):
                return idx
        include_name = os.path.basename(include_line.group("name"))
        include_base, include_ext = os.path.splitext(include_name)
        file_base, file_ext = os.path.splitext(file_name)
        include_is_related = include_base == file_base and \
            (config_file.is_c_src_file(file_name) or \
             config_file.is_cpp_src_file(file_name))
        if include_is_related:
            return 0
        elif include_line.group("name") in self.c_std:
            return 1
        elif self.c_sys_regex.search(include_line.group("header")):
            return 1
        elif include_line.group("name") in self.cpp_std:
            return 2
        elif include_line.group("open_bracket") == "<":
            return 3
        elif self.include_is_header(config_file, file_name, include_name):
            return 4
        else:
            return -1
def classify_header ( self , config_file , include_line , file_name ) : for idx in range ( 5 ) : if self . override_regexes [ idx ] . search ( include_line . group ( "name" ) ) : return idx include_name = os . path . basename ( include_line . group ( "name" ) ) include_base , include_ext = os . path . splitext ( include_name ) file_base , file_ext = os . path . splitext ( file_name ) include_is_related = include_base == file_base and ( config_file . is_c_src_file ( file_name ) or config_file . is_cpp_src_file ( file_name ) ) if include_is_related : return 0 elif include_line . group ( "name" ) in self . c_std : return 1 elif self . c_sys_regex . search ( include_line . group ( "header" ) ) : return 1 elif include_line . group ( "name" ) in self . cpp_std : return 2 elif include_line . group ( "open_bracket" ) == "<" : return 3 elif self . include_is_header ( config_file , file_name , include_name ) : return 4 else : return - 1
Classify the given header name and return the corresponding index.
Classify the given header name and return the corresponding index .
"""Classify the given header name and return the corresponding index.

        Keyword arguments:
        config_file -- Config object
        include_line -- regex Match object for include line
        file_name -- file name string

        Returns header classification index.
        """ # Process override regexes # Is related if include has same base name as file name and file has a # source extension
self
config_file
include_line
file_name