Warn when sources sit under sbt/Maven layout that bleep won't pick up#596
Open
oyvindberg wants to merge 1 commit into
Open
Warn when sources sit under sbt/Maven layout that bleep won't pick up#596oyvindberg wants to merge 1 commit into
oyvindberg wants to merge 1 commit into
Conversation
Bleep's default source layout resolves to src/<lang>/ because sbt-scope defaults to "". Files placed under src/main/scala, src/main/java, src/main/kotlin, or the src/test/ equivalents are silently invisible to the build — the project compiles as a no-op and you only notice via a runtime ClassNotFoundException (or never, if the no-op project is downstream of nothing). This bit our own KotlinIT, which was a 4-test silent no-op for months. Adds a best-effort heuristic at bootstrap: for each project without an explicit `sources:` or `sbt-scope:`, check whether any of the six suspect directories exists AND contains at least one matching source file AND is not already in the project's resolved sourcesDirs. If so, emit one warn per offender pointing at the file and listing three fixes (move, set sources:, or set sbt-scope:). Costs at most 6 Files.isDirectory probes per project and one Files.walk (short-circuited via anyMatch) per existing suspect dir. Zero false positives on bleep's own multi-project build. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Relationship to #595
This PR catches the layout footgun in general; #595 fixes the specific `KotlinIT` paths that exposed it. They are independent — either can land first. If #595 lands first, the suspect-paths check has nothing in this repo to warn about; if this lands first, `KotlinIT` runs will print warnings until #595 merges (tests still pass; warnings are not errors).
Test plan
🤖 Generated with Claude Code