Configuration.load constructor

Configuration.load(
  1. String path, {
  2. bool global = false,
})

Loads configuration from path.

If global is true, this restricts the configuration to rules that are supported globally.

Throws an IOException if path does not exist or cannot be read. Throws a FormatException if the file contents are invalid.

Implementation

factory Configuration.load(String path, {bool global = false}) {
  final content = File(path).readAsStringSync();
  final sourceUrl = p.toUri(path);
  return parse(content, global: global, sourceUrl: sourceUrl);
}