scalameta / metals

Scala language server with rich IDE features 🚀

Home Page:https://scalameta.org/metals/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generated metals.sbt fails scalafmtSbtCheck

joroKr21 opened this issue · comments

Describe the bug

Often when I work on a project within Metals, it's disrupting my workflow.

  1. I open my project in Metals
  2. I make a change in build.sbt
  3. I click on the prompt by Metals to reimport the project
  4. It does stuff and (re)generates metals.sbt
  5. I'm running an sbt session separately to test etc.
  6. Now my validation command fails because of scalafmtSbtCheck
  7. I need to run scalafmtSbt to fix it
  8. Now I have to reload my sbt session again

Basically it's too many steps I don't want to think about.
I added a workaround in .scalafmt.conf but by default I don't wanna care:
project.excludePaths = ["glob:**/metals.sbt"]

Expected behavior

It works by default.

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

v1.29.0

Extra context or search terms

No response

Thanks for reporting! We should add // scalafmt:off (I think this is the case) to make sure this doesn't fail the check