sbt/sbt-header
62.3
Adequate · 20 September 2026
1k
lines of production code
Scala
primary language
1
measurement over time
What this system is
This system is an sbt plugin designed to automatically manage and validate license headers in source code files. It provides capabilities to detect existing licenses, generate compliant headers using various comment styles and SPDX syntax, and enforce header presence across different source configurations. The tool supports cross-compilation for Scala 2 and 3, handles diverse file types including XML and extensionless files, and allows for customizable exclusion rules and year ranges.
How it got here
2015–2016 — Build modernization and test expansion
6 changes.
The project modernized its build infrastructure by migrating to sbt 1.13 and upgrading to Scala 3, replacing legacy plugins with a more robust suite. Concurrently, the team expanded test coverage by adding scripted tests for header creation and file exclusion logic to ensure reliability.
2017 — comprehensive integration test coverage
8 changes.
This period focused on expanding the integration test suite for the sbt-header plugin to ensure robust validation of its core functionalities. Tests were added to verify header checking, automatic detection, custom license application, and correct handling of various file types including Scala, XML, and hidden files. The work also included verifying the plugin's ability to override default header mappings.
2019–2025 — sbt 2.x migration and test expansion
10 changes.
The project migrated the sbt-header plugin to the sbtheader package to ensure compatibility with sbt 2.x and Scala 3, introducing an automated header application mechanism. This refactoring was accompanied by extensive test coverage additions, including integration tests for incremental updates, custom configurations, and edge cases, as well as unit tests for comment styles and license detection.
Features
Support for configurable license header end years
Users can now explicitly configure the end year for license headers using the new \headerEndYear\ setting key. This allows for precise control over year ranges in generated headers, as demonstrated by the test case that sets a start year of 2015 and an end year of 2022, ensuring the resulting header reflects the specified range rather than relying solely on auto-detection.
src/sbt-test/sbt-header/auto-detection-end-year · high confidence
Behavioural changes
License detection logic updated for sbt 2.x compatibility
The license detection mechanism has been refactored to align with sbt 2.x changes. In Scala 2.12, the implementation now accepts licenses as a sequence of tuples (String, URL) and maps them against SPDX identifiers. In Scala 3, it directly accepts sbt.License objects, extracting the SPDX ID from the license instance. Additionally, a new PluginCompat layer provides version-specific helpers, including an uncached definition for sbt Def in Scala 2.12 and direct access to standard licenses (Apache2, MIT) in Scala 3.
src/main/scala-2.12, src/main/scala-3 · high confidence
Repository maintenance and configuration updates
This change updates the project's internal configuration and documentation. It introduces a \.git-blame-ignore-revs\ file to ignore specific scalafmt reformatting commits, adds a \.scala-steward.conf\ to pin the Scala library version, and updates \.scalafmt.conf\ to version 3.11.5 with new formatting rules. The \shell-prompt.sbt\ file is removed, and \.gitignore\ is expanded to include new tooling artifacts (VSCode, Metals, jenv). The README is significantly rewritten to document the plugin's features, configuration options, and built-in licenses, and the copyright year in the NOTICE file is updated to 2017.
(repo-wide) · high confidence
sbt-header plugin migrated to sbtheader package for sbt 2.x compatibility
The sbt-header plugin has been refactored and moved into the \sbtheader\ package to support sbt 2.x. This change introduces a new \AutomateHeaderPlugin\ that automatically applies license headers during compilation for \Compile\ and \Test\ configurations, while the core \HeaderPlugin\ retains manual control via \headerCreate\ and \headerCheck\ tasks. The implementation now uses Scala 3 source compatibility flags (\-Xsource:3\) and removes the deprecated \Traversable\ type alias, ensuring the plugin functions correctly in modern sbt environments.
src/main/scala · high confidence
Test coverage
Add integration tests for XML header handling; Added incremental header creation test suite; Added integration test for header tasks across all configurations; Added integration tests for header checking across all configurations; Added scripted tests for header creation and file mapping; Added test coverage for header insertion in files without extensions; Added test fixtures for file exclusion logic; Added test fixtures for header application on various file types; Added test fixtures for sbt-header validation; Added test for SPDX license header syntax; Added test for automatic license header detection; Added test for custom license header application; Added test for custom license header style detection; Added tests for overriding default header mappings; Added tests for sbt-header header checking; Added tests for source exclusion in header creation; Added unit tests for sbtheader comment styles, header creation, and license detection; Updated test fixtures for header mapping overrides.
Dependencies
Build system migrated to sbt 1.13 and modernized plugin suite
The project's build configuration has been significantly updated: the build tool version is upgraded from 0.13.7 to 1.13.0, and the legacy \sbt-scalariform\ and \sbt-git\ plugins are replaced with \sbt-ci-release\, \sbt-header\, and \sbt-scalafmt\. Additionally, the previous \Build.scala\ and \Dependencies.scala\ files are removed, indicating a shift in how build settings and dependencies are managed within the project structure.
project · high confidence
Upgrade to Scala 3.8.4 and sbt 2.0.8 with cross-build support
The build configuration has been updated to support cross-compilation for Scala 2.12.21 and Scala 3.8.4. The project now targets sbt 2.0.8 for Scala 3 builds and sbt 1.9.9 for Scala 2.12 builds, with scripted tests also running against sbt 1.11.6 for Scala 2.12. Test dependencies have been updated to ScalaTest 3.2.20, and the build now includes explicit license headers and developer metadata.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 62.
Lenses
- Code Health 100
- Architecture 69
- Maturity 58
- Readiness 59
- Security 70
Changes since last survey
- 300 commits — 283 feature/other, 17 fixes
By area
- (root) — 133 commits
- (repo) — 50 commits
- project/build.properties — 37 commits
- project/plugins.sbt — 24 commits
- src/main — 23 commits
- src/sbt-test — 17 commits
- .github/workflows — 8 commits
- bak/play-twirl — 4 commits
- src/test — 3 commits
- .github/dependabot.yml — 1 commit
Notable commits
- fix: Bugfix: Use the right sbt cache API (#171)
- fix: Fix C++ and Hash styles with headerEmptyLine := false (#314)
- fix: Fix HeaderCreator leaking file descriptors (#128)
- fix: Fix StackOverflow for XML file (#309)
- fix: Fix and update GitHub release action (#274)
- fix: Fix broken link. (#125)
- fix: Fix docs for supporting alternative configurations (#147)
- fix: Fix for compiling with JDK 11 (#179)
- fix: Fix old sbt syntax in README
- fix: Fix sbt-boilerplate documentation (#152)
- fix: Fix scalafmt configuration
- fix: build: fix publish settings
- fix: chore: fix .scalafmt.conf
- fix: ci: fix release workflow
- fix: fix LicenseDetection.apply
- fix: fix publishMavenStyle setting (#278)
- fix: fix warnings
- change: Add 'Reformat with scalafmt 3.6.1' to .git-blame-ignore-revs
- change: Add 'Reformat with scalafmt 3.9.10' to .git-blame-ignore-revs
- change: Add IdentityCommentCreator that does not place any spacial characters (#134)
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
sbt/sbt-header was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit c6d5f3a166de2f535e7c683a2cb93fac50cca5c1 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.