scalafix-noinfer

A Scalafix rule to suppress specific type inference.

License

License

Categories

Categories

Scala Languages Infer Application Testing & Monitoring Code Analysis
GroupId

GroupId

com.eed3si9n.fix
ArtifactId

ArtifactId

scalafix-noinfer_2.12
Last Version

Last Version

0.1.0-M1
Release Date

Release Date

Type

Type

jar
Description

Description

scalafix-noinfer
A Scalafix rule to suppress specific type inference.
Project URL

Project URL

https://github.com/eed3si9n/scalafix-noinfer
Project Organization

Project Organization

eed3si9n
Source Code Management

Source Code Management

https://github.com/eed3si9n/scalafix-noinfer

Download scalafix-noinfer_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.eed3si9n.fix/scalafix-noinfer_2.12/ -->
<dependency>
    <groupId>com.eed3si9n.fix</groupId>
    <artifactId>scalafix-noinfer_2.12</artifactId>
    <version>0.1.0-M1</version>
</dependency>
// https://jarcasting.com/artifacts/com.eed3si9n.fix/scalafix-noinfer_2.12/
implementation 'com.eed3si9n.fix:scalafix-noinfer_2.12:0.1.0-M1'
// https://jarcasting.com/artifacts/com.eed3si9n.fix/scalafix-noinfer_2.12/
implementation ("com.eed3si9n.fix:scalafix-noinfer_2.12:0.1.0-M1")
'com.eed3si9n.fix:scalafix-noinfer_2.12:jar:0.1.0-M1'
<dependency org="com.eed3si9n.fix" name="scalafix-noinfer_2.12" rev="0.1.0-M1">
  <artifact name="scalafix-noinfer_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.eed3si9n.fix', module='scalafix-noinfer_2.12', version='0.1.0-M1')
)
libraryDependencies += "com.eed3si9n.fix" % "scalafix-noinfer_2.12" % "0.1.0-M1"
[com.eed3si9n.fix/scalafix-noinfer_2.12 "0.1.0-M1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.6
ch.epfl.scala : scalafix-core_2.12 jar 0.8.0-RC1

Project Modules

There are no modules declared in this project.

scalafix-noinfer

scalafix-noinfer is a Scalafix rule to warn about undesired type inference. It offers a replacement for the NoInfer rule that was built into Scalafix 0.5.

See the blog post stricter Scala with -Xlint, -Xfatal-warnings, and Scalafix.

Installation

In a project with Scalafix enabled (0.9.0 or later):

build.sbt

ThisBuild / scalafixDependencies +=
  "com.eed3si9n.fix" %% "scalafix-noinfer" % "0.1.0-M1"

lazy val root = (project in file(".")).
  settings(
    name := "hello",
    addCompilerPlugin(scalafixSemanticdb),
    scalacOptions ++= List(
      "-P:semanticdb:synthetics:on",
      "-Yrangepos",
    ),
  )

.scalafix.conf

rules = [
  NoInfer
]

Usage

Run scalafix or scalafix NoInfer with sbt.

Configuration

By default this rule forbids the inference of scala.Any, scala.AnyVal, java.io.Serializable, scala.Serializable, and scala.Product. You can customize this using .scalafix.conf as follows:

rules = [
  NoInfer
]
NoInfer.disabledTypes = [
  scala.Any
  scala.AnyVal
  scala.Serializable
  java.io.Serializable
  scala.Product
  scala.Predef.any2stringadd
]

License

Apache-2.0

Versions

Version
0.1.0-M1