Skip to content
A simplistic Scalafix rule that sorts imports
Scala
Branch: master
Clone or download
pjrt and NeQuissimus Update README's config example (#7)
* Update README's config example

This will take care of issue #6 without requiring code changes

* Add the `.` to the `com.sun` part as well.
Latest commit 736eef2 Sep 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Do not release from branches Jun 23, 2019
scalafix Add test for local import list Sep 8, 2019
.gitignore Test Jun 20, 2019
readme.md Update README's config example (#7) Sep 9, 2019

readme.md

SortImports

Description

SortImports is a simplistic Scalafix rule.

It will organize imports into prefix-blocks and order imports inside those blocks alphabetically.

For example, these imports

import scala.util._
import scala.collection._
import java.util.Map
import com.oracle.net._
import com.sun._

will be organized as follows

import java.util.Map

import scala.collection._
import scala.util._

import com.oracle.net._

import com.sun._

if the blocks from the below Configuration example are used.

Important sort-imports does not (currently) take into account shadowing. It is a faily dumb sorter of imports. If your code is using shadowing, it may end up no longer compiling!

Usage

scalafixDependencies += "com.nequissimus" %% "sort-imports" % "0.2.1"

Configuration

rule = SortImports
SortImports.blocks = [
  "java.",
  "scala.",
  "*",
  "com.sun."
]
You can’t perform that action at this time.