Repository: facebookresearch/hydra

Issue:
Hydra returns empty config for .yml files.
Hydra produces an empty config when the file has a .yml extension as opposed to a .yaml extension.

A minimal reproduction is here:
hydra_test.py
```
import hydra
class A:
    def __init__(self, **kwargs):
        print(kwargs)


@hydra.main('./config_test.yml')
def main(cfg):
    print(cfg)
    print(cfg.obj_test)
    print("ASDFASDFASDFAFSD")
    hydra.utils.instantiate(cfg.obj_test)


if __name__ == '__main__':
    main()
```

config_test.yml / config_test.yaml
```
obj_test:
  class: hydra_test.A
  params:
    a: 123
    b: 421
```

Put both of these files into the same folder and run with `python hydra_test.py`


Discussion:

Resolving patch:
diff --git a/hydra/_internal/config_loader.py b/hydra/_internal/config_loader.py
--- a/hydra/_internal/config_loader.py
+++ b/hydra/_internal/config_loader.py
@@ -72,9 +72,6 @@ def _find_config(self, filepath, including_config_dir):
             else:
                 config_file = os.path.join(path, filepath)
 
-            if not config_file.endswith(".yaml"):
-                config_file = config_file + ".yaml"
-
             if self._exists(is_pkg, config_file):
                 return prefix + config_file
         return None
@@ -296,7 +293,7 @@ def _merge_defaults(self, cfg, cfg_filename):
                     cfg = self._merge_config(
                         cfg=cfg,
                         family=os.path.join(conf_dirname, family),
-                        name=name,
+                        name="{}.yaml".format(name),
                         required=not is_optional,
                         including_config_dir=True,
                     )
@@ -306,7 +303,7 @@ def _merge_defaults(self, cfg, cfg_filename):
                 cfg = self._merge_config(
                     cfg=cfg,
                     family=conf_dirname,
-                    name=default,
+                    name="{}.yaml".format(default),
                     required=True,
                     including_config_dir=True,
                 )


Test patch:
diff --git a/tests/configs/config.yml b/tests/configs/config.yml
new file mode 100644
--- /dev/null
+++ b/tests/configs/config.yml
@@ -0,0 +1 @@
+yml_file_here: true
\ No newline at end of file
diff --git a/tests/test_conf_loader.py b/tests/test_conf_loader.py
--- a/tests/test_conf_loader.py
+++ b/tests/test_conf_loader.py
@@ -3,11 +3,11 @@
 import os
 
 import pytest
+from omegaconf import OmegaConf
 
 from hydra._internal.config_loader import ConfigLoader
 from hydra.errors import MissingConfigException
 from hydra.test_utils.test_utils import chdir_hydra_root
-from omegaconf import OmegaConf
 
 chdir_hydra_root()
 
@@ -123,7 +123,7 @@ def test_load_history():
         ("pkg://hydra.default_conf.job_logging/default.yaml", True),
         ("pkg://hydra.default_conf.launcher/basic.yaml", True),
         ("pkg://hydra.default_conf.sweeper/basic.yaml", True),
-        ("foo/missing", False),
+        ("foo/missing.yaml", False),
     ]
 
 
@@ -177,3 +177,15 @@ def test_load_strict():
     )
     with pytest.raises(KeyError):
         config_loader.load_configuration(overrides=["dataset.bad_key=foobar"])
+
+
+def test_load_yml_file():
+    config_loader = ConfigLoader(
+        config_path=["pkg://hydra.default_conf"],
+        strict_cfg=False,
+        conf_filename="config.yml",
+        conf_dir="tests/configs",
+    )
+    cfg = config_loader.load_configuration()
+    del cfg["hydra"]
+    assert cfg == dict(yml_file_here=True)