Quick note: I noticed that with parseFile, the file is opened before the filetype is validated. This PR pulls out the filetype validation and creates a new function getParseFunc which will return the appropriate parser function to run (if the filetype is supported). ReadConfig and ReadConfigFS then just keep going with the returned function.
Tests were added for both ReadConfigFS and getParseFunc.
Attempt at implementing #135 .
Quick note: I noticed that with
parseFile
, the file is opened before the filetype is validated. This PR pulls out the filetype validation and creates a new functiongetParseFunc
which will return the appropriate parser function to run (if the filetype is supported).ReadConfig
andReadConfigFS
then just keep going with the returned function.Tests were added for both
ReadConfigFS
andgetParseFunc
.