restrict-imports-enforcer-rule
restrict-imports-enforcer-rule copied to clipboard
Add Scala support
Now that we have better support for different languages, we could try implementing Scala support on top of the current matching algorithm. This poses the following challenges:
- Scala allows you to place
import
statements everywhere. So we can not eagerly break the file consumption in case no import has been found. We have to scan the whole file. - Scala allows nested
package
declarations everywhere. So we can not find a class's package name by simply scanning finding the first line starting withpackage
.
Overall, Scala's import
and package
statements do not fit our current matching architecture at all. This ticket may be used to collect ideas and use cases for scala support before I'll actually start to implement this.