Credo v1.1.5 Credo.SourceFile View Source

SourceFile structs represent a source file in the codebase.

Link to this section Summary

Functions

Retuns the AST for the given source_file

Returns the column of the given trigger inside the given line

Returns the line at the given line_no

Returns the snippet at the given line_no between column1 and column2

Retuns the lines of source code for the given source_file

Retuns a SourceFile struct for the given source code and filename

Retuns the source code for the given source_file

Retuns the source code and filename for the given source_file_or_source

Link to this section Types

Link to this type t() View Source
t() :: %Credo.SourceFile{
  filename: nil | String.t(),
  status: :valid | :invalid | :timed_out
}

Link to this section Functions

Retuns the AST for the given source_file.

Link to this function column(source_file, line_no, trigger) View Source

Returns the column of the given trigger inside the given line.

NOTE: Both line_no and the returned index are 1-based.

Link to this function line_at(source_file, line_no) View Source

Returns the line at the given line_no.

NOTE: line_no is a 1-based index.

Link to this function line_at(source_file, line_no, column1, column2) View Source

Returns the snippet at the given line_no between column1 and column2.

NOTE: line_no is a 1-based index.

Retuns the lines of source code for the given source_file.

Retuns a SourceFile struct for the given source code and filename.

Retuns the source code for the given source_file.

Link to this function source_and_filename(source_file_or_source, default_filename \\ "nofilename") View Source

Retuns the source code and filename for the given source_file_or_source.

Link to this function timed_out(filename) View Source
timed_out(String.t()) :: t()