third_party/blink/tools/blinkpy/style/checker.py
def _file_type(self, file_path):
        """Return the file type corresponding to the given file."""
        file_extension = self._file_extension(file_path)

        if (file_extension in _CPP_FILE_EXTENSIONS) or (file_path == '-'):
            # FIXME: Do something about the comment below and the issue it
            #        raises since cpp_style already relies on the extension.
            #
            # Treat stdin as C++. Since the extension is unknown when
            # reading from stdin, cpp_style tests should not rely on
            # the extension.
            return FileType.CPP
        elif file_extension == _JSON_FILE_EXTENSION:
            return FileType.JSON
        elif file_extension == _PYTHON_FILE_EXTENSION:
            return FileType.PYTHON
        elif file_extension in _XML_FILE_EXTENSIONS:
            return FileType.XML
        elif file_extension == _XCODEPROJ_FILE_EXTENSION:
            return FileType.XCODEPROJ
        elif file_extension == _PNG_FILE_EXTENSION:
            return FileType.PNG
        elif (file_extension in _TEXT_FILE_EXTENSIONS
              or os.path.basename(file_path) == 'TestExpectations'):
            return FileType.TEXT
        else:
            return FileType.NONE
Return the file type corresponding to the given file.
Return the file type corresponding to the given file.
Return the file type corresponding to the given file .
def _file_type(self, file_path):
        file_extension = self._file_extension(file_path)
        if (file_extension in _CPP_FILE_EXTENSIONS) or (file_path == '-'):
             Treat stdin as C++. Since the extension is unknown when
             reading from stdin, cpp_style tests should not rely on
             the extension.
            return FileType.CPP
        elif file_extension == _JSON_FILE_EXTENSION:
            return FileType.JSON
        elif file_extension == _PYTHON_FILE_EXTENSION:
            return FileType.PYTHON
        elif file_extension in _XML_FILE_EXTENSIONS:
            return FileType.XML
        elif file_extension == _XCODEPROJ_FILE_EXTENSION:
            return FileType.XCODEPROJ
        elif file_extension == _PNG_FILE_EXTENSION:
            return FileType.PNG
        elif (file_extension in _TEXT_FILE_EXTENSIONS
              or os.path.basename(file_path) == 'TestExpectations'):
            return FileType.TEXT
        else:
            return FileType.NONE
def _file_type ( self , file_path ) : file_extension = self . _file_extension ( file_path ) if ( file_extension in _CPP_FILE_EXTENSIONS ) or ( file_path == '-' ) : return FileType . CPP elif file_extension == _JSON_FILE_EXTENSION : return FileType . JSON elif file_extension == _PYTHON_FILE_EXTENSION : return FileType . PYTHON elif file_extension in _XML_FILE_EXTENSIONS : return FileType . XML elif file_extension == _XCODEPROJ_FILE_EXTENSION : return FileType . XCODEPROJ elif file_extension == _PNG_FILE_EXTENSION : return FileType . PNG elif ( file_extension in _TEXT_FILE_EXTENSIONS or os . path . basename ( file_path ) == 'TestExpectations' ) : return FileType . TEXT else : return FileType . NONE
Return the file type corresponding to the given file.
Return the file type corresponding to the given file .
"""Return the file type corresponding to the given file.""" # FIXME: Do something about the comment below and the issue it #        raises since cpp_style already relies on the extension. # # Treat stdin as C++. Since the extension is unknown when # reading from stdin, cpp_style tests should not rely on # the extension.
self
file_path