Transformers

Run Scalafmt automatically on your Scala code

Ensure code styling consistency by running Scalafmt formatter on every commit, automatically.

Pick a repository to start formatting your code

Looking for a self-hosted deployment? Schedule a demo →

Ensure consistent code style across the repository

src/main/scala/com/deepsource/marvin/rules/syntactic/BrokenOddness.scala CHANGED
@@ -16,8 +16,17 @@ case class FoundBrokenOddness(num: Lit) extends Diagnostic {
16
16
  override def run(): Unit = {
17
17
  tree.collect {
18
+ case Term.ApplyInfix(
19
+ Term.ApplyInfix(
20
+ t @ Lit.Int(num),
18
- case Term.ApplyInfix(Term.ApplyInfix([email protected](num), Term.Name("%"), _,
21
+ Term.Name("%"),
22
+ _,
23
+ List(Lit.Int(2))
24
+ ),
19
- List(Lit.Int(2))), Term.Name("=="), _, List(Lit.Int(1))) =>
25
+ Term.Name("=="),
26
+ _,
27
+ List(Lit.Int(1))
28
+ ) =>
20
29
  if (num < 0)
21
30
  Patch.lint(FoundBrokenOddness(t))
22
31
  }
The best way to run your favorite code formatter Run one of them or all of them. DeepSource makes sure your code is always formatted, without any conflicts.

Never think about code formatting again

Never let a formatting issue break the CI build A poorly formatted code means bad news for passing those checks. Our transformers ensure that formatting issues never become a reason for failed checks again.
Save countless hours in manual reviews Manual code reviews means hours of hard work plus a possibility of mistakes. Our transformers take this load off of code reviewers.
Focus on more important tasks Our transformers automatically format your code, even before you realize your code had problems – so you can focus on what matters the most.
Free for personal accounts and small teams
After that, DeepSource grows with your team with per user pricing plans.
Unlimited public repositories
Unlimited lines of code analyzed
Unlimited private repositories for individual accounts
1 private repository for teams/organizations
Continuous analysis with GitHub, GitLab, and Bitbucket
3 team members
$0/month Get started for free No credit card required