logtalk_linter_hook/7

Description

logtalk_linter_hook(Goal, Flag, File, Lines, Type, Entity, Warning)

Multifile user-defined predicate, supporting the definition of custom linter warnings. Experimental. The Goal argument can be a message sending goal, Object::Message, a call to a Prolog built-in predicate, or a call to a module predicate, Module:Predicate. The Flag argument must be a supported linter flag. The Warning argument must be a valid core message term.

Modes and number of proofs

logtalk_linter_hook(@callable, +atom, +atom, +pair(integer), +atom, @object_identifier, --callable) - zero_or_more

Errors

(none)

Examples

:- multifile(user::logtalk_linter_hook/7).
user::logtalk_linter_hook(
    list::append(L1,L2,L), suspicious_calls,
    File, Lines, Type, Entity,
    suspicious_call(File, Lines, Type, Entity, list::append(L1,L2,L), [L=[X|L2]])
) :-
    L1 = [X| Tail],
    Tail == [].