question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrectly separating imports

See original GitHub issue

My .scalafix.conf is:

rules = [
  OrganizeImports,
  RemoveUnused
]

RemoveUnused {
  imports  = false
  privates = true
  locals   = true
}

OrganizeImports {
  expandRelative       = true
  groupedImports       = Merge
  groups               = ["*"]
  importSelectorsOrder = Ascii
  removeUnused         = true
}

and when I format this:

import cats.CommutativeApplicative
import cats.effect.IO
import cats.effect.IO.ioEffect
import java.time.{Duration, Instant}
import scala.collection.Factory
import scala.concurrent.blocking
import scalaz.{-\/, BindRec, Catchable, Monad, \/, \/-}

it turns it into this:

import cats.CommutativeApplicative
import cats.effect.IO
import java.time.{Duration, Instant}
import scala.collection.Factory
import scala.concurrent.blocking
import scalaz.{-\/, BindRec, Catchable, Monad, \/, \/-}

import cats.effect.IO.ioEffect

It should do nothing according to my config.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

2reactions
lianchengcommented, May 20, 2020

@sideeffffect, you got a comrade 😃 Now I’m convinced.

0reactions
lianchengcommented, May 25, 2020

Fixed in #61 and made available in the newly cut 0.3.1-RC2 release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incorrect import order with code splitting and multiple entry ...
Using ECMAScript module imports means having to write your code to be robust to different import execution orders. The bundling algorithm in ...
Read more >
Imports are incorrectly sorted and/or formatted | VS Code
I was able to get around it by splitting up my imports so that they don't get auto-formatted to be on multiple lines....
Read more >
Tackling the most common errors when trying to import a CSV
Every line should be separated by a clear line break. That's it! There is no deviation from this pattern, no matter what dataset...
Read more >
Outlook shows a Translation Error during the import of a ...
Translation Error A file error has occured in the Comma Separated Values translator while initializing a translator to build a field map.
Read more >
Imports
FileUtils; // Violation should be separated by space import ... violation, extra separation before import // and wrong order, comes before ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found