Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eed3si9n/scalafix-noinfer
https://github.com/eed3si9n/scalafix-noinfer
scalafix
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/eed3si9n/scalafix-noinfer
- Owner: eed3si9n
- Created: 2018-09-20T22:37:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T16:42:26.000Z (over 4 years ago)
- Last Synced: 2024-10-03T17:59:57.428Z (3 months ago)
- Topics: scalafix
- Language: Scala
- Size: 4.88 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
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][blog post].[blog post]: http://eed3si9n.com/stricter-scala-with-xlint-xfatal-warnings-and-scalafix
### Installation
In a project with Scalafix enabled (0.9.0 or later):
#### build.sbt
```scala
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