def read_config(file_name):
    """Read configuration."""

    config = {}
    for name in (['.pyspelling.yml', '.spelling.yml'] if not file_name else [file_name]):
        if os.path.exists(name):
            if not file_name and name == '.spelling.yml':
                warn_deprecated(
                    "Using '.spelling.yml' as the default is deprecated. Default config is now '.pyspelling.yml'"
                )
            with codecs.open(name, 'r', encoding='utf-8') as f:
                config = yaml_load(f.read())
            break
    return config
def read_config ( file_name ) : config = { } for name in ( [ '.pyspelling.yml' , '.spelling.yml' ] if not file_name else [ file_name ] ) : if os . path . exists ( name ) : if not file_name and name == '.spelling.yml' : warn_deprecated ( "Using '.spelling.yml' as the default is deprecated. Default config is now '.pyspelling.yml'" ) with codecs . open ( name , 'r' , encoding = 'utf-8' ) as f : config = yaml_load ( f . read ( ) ) break return config
Read configuration.