pdalpra / scalalint

A Scala linter built on Scalafix
https://www.scalalint.org
7 stars 1 forks source link

Relative import false positive (org.scalatest.FunSuite) #38

Open gdeOo opened 4 years ago

gdeOo commented 4 years ago

A file containing only the following import reports it as a relative import.

import org.scalatest.FunSuite
[error] TestTest.scala:1:8: error: [ScalalintImports] Relative imports are disallowed=> test / Test / scalafix 0s
[error] import org.scalatest.FunSuite
[error]        ^^^^^^^^^^^^^^^^^^^^^^

Other imports from the same package are not reported. The following is fine, for example:

import org.scalatest.OptionValues

Not sure if relevant, but I'm using version scalatest_2.12 3.1.0.

pdalpra commented 4 years ago

Thx for reporting, I'll have a look!

pdalpra commented 4 years ago

It seems that the rule does not take type aliases into account, and detects type aliases as relative imports.

pdalpra commented 4 years ago

Very sorry about the huge delay, didn't have as much free time as I'd like to tackle it... Going to fix this in the coming days.