https://github.com/vic/nonono
NoNoNo is an Scala3 compiler plugin that lets you prevent unsafe function calls.
https://github.com/vic/nonono
compiler-plugin dotty dotty-plugin scala3 scala3-plugin wartremover
Last synced: 4 months ago
JSON representation
NoNoNo is an Scala3 compiler plugin that lets you prevent unsafe function calls.
- Host: GitHub
- URL: https://github.com/vic/nonono
- Owner: vic
- License: apache-2.0
- Created: 2022-03-14T07:35:36.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-14T23:49:59.000Z (over 3 years ago)
- Last Synced: 2024-12-25T12:26:06.971Z (6 months ago)
- Topics: compiler-plugin, dotty, dotty-plugin, scala3, scala3-plugin, wartremover
- Language: Scala
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NoNoNo
An Scala3 compiler plugin that lets you prevent unsafe function calls.
### Setup
TODO: release jars.
TODO: usage with sbt
TODO: usage with mill```scala
scalac -Xplugin:nonono.jar Something.scala
```### Configuration
Suppose you want to prevent developers using `Option.get` on your codebase.
The following NoNoNo definition prevents such cases:
```scala
NoNoNo[Option[Any]](_.get)("Prefer using getOrElse")
```
TODO: currently, the plugin expects NoNoNo definitions on the same compilation unit. Make it possible for the plugin to take an option with a scala file to read definitions from.
You can customize the type parameter to match for example, only `Option[String]`.
See more examples in [tests](nonono-plugin/tests/src/nonono/PluginTest.scala)