Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xuwei-k/unused-code
find and remove unused scala code
https://github.com/xuwei-k/unused-code
sbt-plugin scala scalafix-rule
Last synced: 6 days ago
JSON representation
find and remove unused scala code
- Host: GitHub
- URL: https://github.com/xuwei-k/unused-code
- Owner: xuwei-k
- License: mit
- Created: 2022-02-12T08:54:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-23T04:11:51.000Z (14 days ago)
- Last Synced: 2024-10-27T01:18:27.548Z (10 days ago)
- Topics: sbt-plugin, scala, scalafix-rule
- Language: Scala
- Homepage:
- Size: 85.9 KB
- Stars: 68
- Watchers: 8
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Unused Code
[![maven](https://img.shields.io/maven-central/v/com.github.xuwei-k/unused-code-scalafix_2.13)](https://search.maven.org/artifact/com.github.xuwei-k/unused-code-scalafix_2.13)
[![scaladoc](https://javadoc.io/badge2/com.github.xuwei-k/unused-code-scalafix_2.13/javadoc.svg)](https://javadoc.io/doc/com.github.xuwei-k/unused-code-scalafix_2.13/latest/unused_code/index.html)find and warn, remove unused public classes, methods by scalafix SyntacticRule.
## setup
### `project/plugins.sbt`
```scala
addSbtPlugin("com.github.xuwei-k" % "unused-code-plugin" % "version")
```### sbt shell
```
> unusedCode
> scalafix WarnUnusedCode
> scalafix RemoveUnusedCode
```### config example
`build.sbt`
```scala
import scala.concurrent.duration.*ThisBuild / unusedCodeConfig ~= { c =>
c.copy(
excludeNameRegex = Set(
".*Server"
),
excludePath = c.excludePath ++ Set(
"glob:some-project/**"
),
excludeGitLastCommit = Some(
365.days
),
excludeMainMethod = false,
dialect = unused_code.Dialect.Scala3,
)
}
```