For a custom ArchCondition that checks the definition of a JavaClass/JavaMethod/JavaField it would be useful to append the declaration line to the error message as clickable link.
Example:
all(javaMethods).should(haveNameStartingWithLowerCase()).check(javaClasses);
private ArchCondition<JavaMethod> haveNameStartingWithLowerCase() {
return new ArchCondition<JavaMethod>("have name starting with lower case") {
@Override
public void check(JavaMethod item, ConditionEvents events) {
boolean satisfied = Character.isLowerCase(item.getName().charAt(0));
String message = item.getFullName() + " " + Formatters.formatLocation(item.getOwner(), item.getDeclarationLineNumber());
events.add(new SimpleConditionEvent(item, satisfied, message));
}
};
}
would print
java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'methods should have name starting with lower case' was violated (1 times):
demo.GreetEndpoint.Greet(java.lang.String) (GreetEndpoint.java:23)
Relates to #38
For a custom ArchCondition that checks the definition of a JavaClass/JavaMethod/JavaField it would be useful to append the declaration line to the error message as clickable link.
Example:
would print
Relates to #38