A frequent need:
val prefix = String.format(s"%${offset - 2}s |", lineNbr)
written as
f"$lineNbr%${offset - 2}s |"
At compile time, it's only necessary to verify that the interpolation in the formatting directive is an int.
Perhaps other interpolated directives would be tricky to verify and might be rejected.