Resolves EditorConfig properties for files.
This package targets EditorConfig specification 0.17.2.
Summary
Functions
Parses one .editorconfig file.
Resolves EditorConfig properties for path.
Resolves properties and includes contributing config file/section sources.
Returns the EditorConfig specification version targeted by this package.
Returns the package version.
Functions
@spec parse( binary(), keyword() ) :: {:ok, EditorConfig.File.t()} | {:error, term()}
Parses one .editorconfig file.
Examples
iex> {:ok, file} = EditorConfig.parse("[*]\nindent_style = space\n")
iex> hd(file.sections).properties
%{"indent_style" => "space"}
Resolves EditorConfig properties for path.
Examples
iex> fs = EditorConfig.FileSystem.Memory.new(%{
...> "/project/.editorconfig" => "root = true\n[*]\nindent_style = space\n"
...> })
iex> EditorConfig.properties("/project/file.ex", fs: fs)
{:ok, %{"indent_style" => "space"}}
Resolves properties and includes contributing config file/section sources.
Examples
iex> fs = EditorConfig.FileSystem.Memory.new(%{
...> "/project/.editorconfig" => "root = true\n[*]\nindent_style = space\n"
...> })
iex> EditorConfig.properties_with_sources("/project/file.ex", fs: fs)
{:ok, %{"indent_style" => "space"}, [{"/project/.editorconfig", "*"}]}
@spec spec_version() :: String.t()
Returns the EditorConfig specification version targeted by this package.
Examples
iex> EditorConfig.spec_version()
"0.17.2"
@spec version() :: String.t()
Returns the package version.
Examples
iex> EditorConfig.version()
"0.1.0"