The settings for files in directory, from the nearest jacket.toml at or above it (up to
stop), with read supplying file contents. file is the jacket.toml that was used, or ""
for the defaults.
reader :: (path: string) -> string, bool {
if path == "/project/jacket.toml" return "[format]\nindent_width = 2\n", true;
return "", false;
}
config, file, ok := format_find_config("/project/src", reader);
assert(ok && file == "/project/jacket.toml" && config.indent_width == 2);format_find_config :: (
directory: string,
read: Format_File_Reader,
stop := ""
) -> (config: Format_Config, file: string, ok: bool, error: string)
Parameters
- directory: string
- read: Format_File_Reader
- stop := ""
Returns
- config: Format_Config
- file: string
- ok: bool
- error: string