Skip to content

Feat: Add Scala SDK - #164

Merged
markovejnovic merged 10 commits into
harmont-dev:mainfrom
Yummy-Yums:main
Jul 29, 2026
Merged

Feat: Add Scala SDK#164
markovejnovic merged 10 commits into
harmont-dev:mainfrom
Yummy-Yums:main

Conversation

@Yummy-Yums

Copy link
Copy Markdown
Contributor

No description provided.

@Yummy-Yums
Yummy-Yums marked this pull request as ready for review July 27, 2026 12:17

@markovejnovic markovejnovic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for your PR! Left some comments, but not blocking. Feel free to merge. I'll make a follow-up pass afterwards.

.coverage
htmlcov/
.vscode/
git No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd avoid gitignoring this. I can imagine we create a git/ directory and I think this would filter it out

Comment on lines 12 to 15
dependencies = [
"pytest>=9.0.3",
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would avoid adding this since pytest is already under project.optional-dependencies.dev.

Comment on lines 1 to -2
version = 1
revision = 3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In theory, after you revert your pyproject.toml you'll be able to drop changes on this file.

Comment thread examples/scala/.hm/pipeline.py Outdated
Comment on lines +8 to +19
@hm.target()
def project() -> ScalaProject:
return hm.scala.project(path=".")


@hm.pipeline(
"ci",
env={"CI": "true"},
triggers=[hm.push(branch="main")]
)
def ci(project: hm.Target[ScalaProject]) -> tuple[hm.Step, ...]:
return project.ci()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
@hm.target()
def project() -> ScalaProject:
return hm.scala.project(path=".")
@hm.pipeline(
"ci",
env={"CI": "true"},
triggers=[hm.push(branch="main")]
)
def ci(project: hm.Target[ScalaProject]) -> tuple[hm.Step, ...]:
return project.ci()
@hm.pipeline(
"ci",
env={"CI": "true"},
triggers=[hm.push(branch="main")]
)
def ci(project: hm.Target[ScalaProject]) -> tuple[hm.Step, ...]:
project = hm.scala.project(path=".")
return project.ci()

Just so the example is slightly shorter! =)

Comment thread .gitignore Outdated
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
# .idea/
.idea/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
.idea/
.idea/

Comment on lines +307 to +310
build_file_path = f"{path}/build.sbt" if path != "." else "build.sbt"
properties_file = f"{path}/project/build.properties" if path != "." else "project/build.properties"
scala_main_glob = f"{path}/**/src/main/*.scala" if path != "." else "**/src/main/*.scala"
scala_test_glob = f"{path}/**/src/test/*.scala" if path != "." else "**/src/test/*.scala"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, this hard-coded stuff kind of fears me.

I don't completely understand scala's canonical project structure but I suspect there will always be an edge-case wherein people do not have conventional/common/simple project structures so this hard-coded glob wouldn't fit.

For example, someone could create *.test.scala files to indicate tests? These globs would cause that build to not be buildable within hm.

But I think this is OK for now. I don't want perfect to be the enemy of good, and I want to spend time getting claude to write hm files for real-world projects to research what would be the best interface.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is scala's canonical project structure and yes you're right there might be edge cases but largely this is the convention and it stems from the jvm world. Scala files whether test or source files are still .scala which is in the src/tests folder

Yummy-Yums and others added 3 commits July 28, 2026 11:55
…nit scaffold

- Example pipeline: drop the unresolved `project: hm.Target[...]` parameter that
  crashed rendering ("target 'project' not found"); call
  `hm.scala.project(".").ci()` directly.
- pyproject: remove pytest from runtime `dependencies` (already a dev dep);
  restore uv.lock to the tracked revision, dropping unrelated churn.
- fmt defaults to check=True (`sbt scalafmtCheckAll`) so `ci()` verifies
  formatting instead of silently reformatting; ScalaProject.fmt delegates to the
  toolchain step (chains off install, parallel to warmup), mirroring Rust.
- Fix `_test_cmd` construction (spacing, `--` options, str-coerce + shlex-quote)
  and add parametrized coverage.
- Drop the dead `components` param and the invalid `ScalaProject.setup` (no
  `installed` field); remove TODOs; reformat to 4-space; fix isort order; export
  `ScalaProject`.
- Rewrite docstrings to the real API (`hm.scala.toolchain`/`project`, not
  `hm.scala()`/`clippy`/`version=`).
- Fix tests that asserted nothing or targeted `hm.rust`; align label/scalafmt
  expectations.
- Add the missing `hm init` Scala template + wiring and a roundtrip test.
- Revert unrelated root `.gitignore` `.idea/` flip and the stray `git ` entry.

Note: pipeline-SDK reference docs are generated from these docstrings in the
parent repo via `make docs-generate` — regenerate there alongside the gitlink bump.
@markovejnovic
markovejnovic merged commit 879008c into harmont-dev:main Jul 29, 2026
15 of 18 checks passed
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.

2 participants