skuzzle/restrict-imports-enforcer-rule

Add Scala support

skuzzle opened this issue · 0 comments

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:

  1. 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.
  2. Scala allows nested package declarations everywhere. So we can not find a class's package name by simply scanning finding the first line starting with package.

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.