/mill-tpolecat

scalac options for the enlightened

Primary LanguageScalaApache License 2.0Apache-2.0

mill-tpolecat

Build Status License Latest Version

scalac options for the enlightened

mill-tpolecat is an extension for the Mill build tool which configures your scalac options according to @tpolecat's recommendations where possible, according to the Scala version you are using.

This should help to ensure that you are getting the greatest possible benefit from the Scala compiler's many linting options.

It has been tested with version 0.9.3 of mill.

Usage

Import the module in build.sc using mill's $ivy import syntax, and extend TpolecatModule in your build definition:

// build.sc

import $ivy.`io.github.davidgregory084::mill-tpolecat:0.2.0`

import io.github.davidgregory084.TpolecatModule

object core extends TpolecatModule {
  def scalaVersion = "2.12.11"
}

If necessary you can filter out scalac options that are not appropriate for your project:

// build.sc

import $ivy.`io.github.davidgregory084::mill-tpolecat:0.2.0`

import io.github.davidgregory084.TpolecatModule

object core extends TpolecatModule {
  def scalaVersion = "2.12.11"
  def scalacOptions = T { super.scalacOptions().filterNot(Set("-Yno-imports")) }
}

Caveat

I can't promise this plugin will work for old minor releases of Scala. It has been tested with:

  • 2.13.2
  • 2.12.11
  • 2.11.12

License

All code in this repository is licensed under the Apache License, Version 2.0. See LICENSE.