rrrene / credo

A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
http://credo-ci.org/
MIT License
4.93k stars 417 forks source link

Exception naming consistency check produces unexpected reasoning #1012

Closed notinecrafter closed 8 months ago

notinecrafter commented 1 year ago

Precheck

This issue occurs when having only two exceptions, and is therefore quite close to https://github.com/rrrene/credo/issues/969. I personally feel that this is slightly different, as this is more about the explanation text rather than that it shows up at all, but feel free to disclose it.

Environment

What were you trying to do?

I had two custom exceptions defined: a NotLoggedInError, and a TokenManagerExitException. I then ran mix credo.

Expected outcome

Exception modules should be named consistently. It seems your strategy is to suffix them with Error, but TokenManagerExitException does not follow that convention.

Actual outcome

Exception modules should be named consistently. It seems your strategy is to prefix them with Not, but TokenManagerExitException does not follow that convention.

Notes

Renaming TokenManagerExitException to TokenManagerExitError resulted in this Exception being removed.

rrrene commented 10 months ago

@notinecrafter Does this happen on Credo 1.7.x as well? Could you check?

rrrene commented 9 months ago

@notinecrafter Checking in đŸ‘†

rrrene commented 8 months ago

Closing this because I suspect this has been fixed in Credo 1.7 - if I am wrong, please re-open! :+1: