Skip to content

Add scalafmt (plugin) to scala-http4s client generator#23300

Merged
wing328 merged 1 commit intoOpenAPITools:masterfrom
Desel72:add-scalafmt-scala-http4s-client
Mar 20, 2026
Merged

Add scalafmt (plugin) to scala-http4s client generator#23300
wing328 merged 1 commit intoOpenAPITools:masterfrom
Desel72:add-scalafmt-scala-http4s-client

Conversation

@Desel72
Copy link
Contributor

@Desel72 Desel72 commented Mar 20, 2026

Summary

  • Adds scalafmt.conf and sbt-scalafmt plugin to the scala-http4s client generator for consistent code formatting
  • Uses runner.dialect = scala3 to match the generator's Scala 3.6.4 target
  • Follows the pattern established in Add scalafmt (plugin) to scala-sttp4 client #23273 for scala-sttp4

Refs #23274

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/scala-http4s.yaml || exit
    
    Commit all changed files.
  • File the PR against the correct branch: master
  • If your PR solves a reported issue, reference it using GitHub's linking syntax
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Add Scalafmt support to the scala-http4s client generator for consistent formatting of generated Scala 3 code. Generates the plugin and config so users can run formatting out of the box.

  • New Features
    • Generate .scalafmt.conf and project/plugins.sbt for scala-http4s clients.
    • Include sbt-scalafmt plugin 2.5.6 and Scalafmt version=3.10.6 with runner.dialect = scala3 (matches Scala 3.6.4 target).
    • Only added when SBT files are generated (skipped if excludeSbt is true).

Written for commit 5bdd297. Summary will update on new commits.

@Desel72
Copy link
Contributor Author

Desel72 commented Mar 20, 2026

@wing328 Could you please review this? If there are any issues, I'd be happy to address them.
Please do not close my PR 😊

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

@wing328 wing328 merged commit 054c65c into OpenAPITools:master Mar 20, 2026
24 checks passed
@wing328
Copy link
Member

wing328 commented Mar 20, 2026

looks good. just merged it

thanks for the contribution

@Desel72
Copy link
Contributor Author

Desel72 commented Mar 20, 2026

@wing328 Shall I continue for other generators?

@Desel72 Desel72 deleted the add-scalafmt-scala-http4s-client branch March 20, 2026 15:50
@wing328
Copy link
Member

wing328 commented Mar 20, 2026

yes feel free to add the same enhancements to other scala client/server generators

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants