Skip to content

feat(formatter): add scalafmt support for Scala files#11632

Closed
kaplan-shaked wants to merge 4 commits intoanomalyco:devfrom
kaplan-shaked:add-scalafmt-formatter
Closed

feat(formatter): add scalafmt support for Scala files#11632
kaplan-shaked wants to merge 4 commits intoanomalyco:devfrom
kaplan-shaked:add-scalafmt-formatter

Conversation

@kaplan-shaked
Copy link
Copy Markdown

@kaplan-shaked kaplan-shaked commented Feb 1, 2026

Summary

  • Add scalafmt formatter with support for .scala, .sbt, and .sc file extensions
  • Formatter is enabled when scalafmt command is available and .scalafmt.conf config file exists
  • Updated formatter documentation to include scalafmt

Changes

  • Added scalafmt formatter definition in packages/opencode/src/format/formatter.ts
  • Updated formatter documentation table in packages/web/src/content/docs/formatters.mdx

Testing

The formatter follows the same pattern as other config-based formatters (ocamlformat, clang-format) and will automatically activate when both the command and config file are present.

Closes #11635

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 1, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 1, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Add scalafmt formatter with support for .scala, .sbt, and .sc files. The formatter is enabled when the scalafmt command is available and a .scalafmt.conf config file is present in the project.

Conflicts:
- Resolved conflict between ormolu (Haskell) and scalafmt (Scala) formatters - kept both as they serve different purposes /Users/shakedkaplan/Documents/code/opencode/.git/COMMIT_EDITMSG
@kaplan-shaked kaplan-shaked force-pushed the add-scalafmt-formatter branch from 7bbe04b to 294912e Compare February 3, 2026 08:30
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

Successfully merging this pull request may close these issues.

Add scalafmt formatter support for Scala files

1 participant