nunomaduro / collision

💥 Collision is a beautiful error reporting tool for command-line applications
https://nunomaduro.com
MIT License
4.51k stars 159 forks source link

Implements Exception CustomEditor #266

Closed fabio-ivona closed 1 year ago

fabio-ivona commented 1 year ago

This PR will add a CustomEditor interface that allows exceptions to define path and line for the code snippet to show in collision rendered editor:

Let's assume (I'm really doing it, a PR will be opened after this will be merged) that in Pest Arch plugin we want to throw a failure when a violation occurs like this one:

image

All is great, but the snippet points out to the test code, not the actual code that violated the rule

we have the path and the line where the violation occurred (see the failure message), but it would be great to throw this

image