Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scalafmt cannot run when buildRoots is set #3359

Open
mattfirtion opened this issue May 20, 2024 · 1 comment
Open

Scalafmt cannot run when buildRoots is set #3359

mattfirtion opened this issue May 20, 2024 · 1 comment

Comments

@mattfirtion
Copy link

When a buildRoot array is set in .scala-steward.conf and scalafmt is upgraded, Scala Steward tries to run scalafmt --non-interactive from the root of the repository instead of the buildRoot, where .scalafmt.conf most likely lives.

2024-05-20 20:35:48,592 WARN  Post-update hook failed
  org.scalasteward.core.io.process$ProcessFailedException: '"SBT_OPTS=-Xmx2048m -Xss8m -XX:MaxMetaspaceSize=512m" scalafmt --non-interactive' exited with code 16.
  error: missing Scalafmt configuration file.
@mattfirtion mattfirtion changed the title Scalafmt cannot run when buildRoot is set Scalafmt cannot run when buildRoots is set May 20, 2024
@fthomas
Copy link
Member

fthomas commented Oct 1, 2024

Thanks for the report, @mattfirtion!

This points to the core of the problem:

Post-update hook failed

Post-update hooks are currently run at the repo level and not the buildRoot level. To change that, we would probably need to store in which buildRoot we found which dependencies (i.e. changing the type of RepoCache#dependencyInfos).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants