ExDNA.AST.Annotator (ExDNA v1.5.2)

Copy Markdown View Source

Pre-processes the AST to handle source comments that suppress clone detection.

ExDNA supports Credo-style comments:

# ex_dna:disable-for-this-file
# ex_dna:disable-for-next-line
# ex_dna:disable-for-previous-line
# ex_dna:disable-for-lines:3

When a suppression comment targets a function or macro definition, that definition is stripped from the AST before fingerprinting.

Summary

Functions

Remove function and macro definitions whose line is suppressed.

Returns suppressed lines from ExDNA config comments in source.

Functions

strip_suppressed(ast, ignored_lines)

@spec strip_suppressed(Macro.t(), MapSet.t(pos_integer()) | :all) :: Macro.t()

Remove function and macro definitions whose line is suppressed.

suppressed_lines(source)

@spec suppressed_lines(String.t()) :: MapSet.t(pos_integer()) | :all

Returns suppressed lines from ExDNA config comments in source.