View Source Credo.CLI.Filename (Credo v1.7.0)
This module can be used to handle filenames given at the command line.
Link to this section Summary
Functions
Returns true
if a given filename
contains a pos_suffix.
Returns a suffix for a filename, which contains a line and column value.
Removes the pos_suffix for a filename.
Adds a pos_suffix to a filename.
Link to this section Functions
Returns true
if a given filename
contains a pos_suffix.
iex> Credo.CLI.Filename.contains_line_no?("lib/credo/sources.ex:39:8")
true
iex> Credo.CLI.Filename.contains_line_no?("lib/credo/sources.ex:39")
true
iex> Credo.CLI.Filename.contains_line_no?("lib/credo/sources.ex")
false
Returns a suffix for a filename, which contains a line and column value.
iex> Credo.CLI.Filename.pos_suffix(39, 8)
":39:8"
iex> Credo.CLI.Filename.pos_suffix(39, nil)
":39"
These are used in this way: lib/credo/sources.ex:39:8
Removes the pos_suffix for a filename.
iex> Credo.CLI.Filename.remove_line_no_and_column("lib/credo/sources.ex:39:8")
"lib/credo/sources.ex"
Adds a pos_suffix to a filename.
iex> Credo.CLI.Filename.with("test/file.exs", %{:line_no => 1, :column => 2})
"test/file.exs:1:2"