The reason why there is a is separate rule for handling Debug.log and one for
handling Debug.todo and Debug.toString, is because these two functions
are reasonable and useful to have in tests.
You can for instance create test data without having to handle the error case
everywhere. If you do enter the error case in the following example, then tests
will fail.
testEmail : Email
testEmail =
case Email.fromString "[email protected]" of
Just email ->
email
Nothing ->
Debug.todo "Supplied an invalid email in tests"
If you want to allow these functions in tests but not in production code, you
can configure the rule like this.
Forbid the use of
Debug.todoandDebug.toString.The reason why there is a is separate rule for handling
Debug.logand one for handlingDebug.todoandDebug.toString, is because these two functions are reasonable and useful to have in tests.You can for instance create test data without having to handle the error case everywhere. If you do enter the error case in the following example, then tests will fail.
If you want to allow these functions in tests but not in production code, you can configure the rule like this.
Fail
Success