BSD-3-Clause licensed by Vaclav Svejcar
Maintained by [email protected]
This version can be pinned in stack with:headroom-0.4.2.0@sha256:ebaf701628054472de745fa57b33ddf1021b99a8e4de5f5b96f21fb296b27652,10873

Would you like to have nice, up-to-date license/copyright headers in your source code files but hate to manage them manually? Then Headroom is the right tool for you. Define your license header as Mustache template, put any template variables into YAML configuarion file, and you’re ready to go!

Headroom also offers much more than just adding, replacing or dropping license headers. It can also update years in copyrights for you, provides content-aware templates for some source code file types, and much more!

asciicast

Main Features

  • License Header Management - Add, replace or drop license headers in your source code files with a single command. What’s more, contrary to many similar tools, Headroom allows you to also replace/drop headers that weren’t previously generated by Headroom, using smart header auto-detection.
  • Powerful Customization - Default configuration should cover most use-cases, but if you need to put empty lines before/after generated header, use different comment style of headers, you can customize the configuration to match exactly your needs.
  • Built-in OSS License Headers - If you want to use license header for one of the popular OSS licenses, then Headroom can generate them for you - no need to search for them on web.
  • Automatic Initialization for OSS Projects - Setting up external tools like Headroom for your project can be boring. Fortunately, Headroom can initialize itself for your project, by generating configuration file and template files.
  • Content-aware Templates - for selected file types, Headroom exposes additional info about processed file using template variables, so you can use info like Java package name in your templates.
  • Copyright Year Updater - Headroom is good not only for basic license header management, but also for further processing of generated headers. Do you need to update years in your copyrights? No problem!

Installation

You can get Headroom via one of the following options:

  1. download pre-built binary for GNU/Linux or macOS (x64) from releases page
  2. install using Homebrew: brew install norcane/tools/headroom
  3. build from source code - see project microsite for more details

Adopters

Here is the list of projects using Headroom. If you’re using Headroom and aren’t on the list, feel free to submit new issue or pull request.

Documentation

Running microsite locally

If you need to show microsite documetation for unreleased version of Headroom (e.g. for master branch), you can run it locally using MkDocs tool:

$ cd doc/microsite/
$ mkdcs serve

Documentation is then available on http://127.0.0.1:8000.

Changes

Changelog

All notable changes to this project will be documented in this file.

0.4.2.0 (released 2021-07-01)

  • [#42] Add option to exclude source paths ignored by VCS
  • [#66] Allow loading templates from HTTP(S) resource
  • Bump LTS Haskell to 18.0

0.4.1.0 (released 2021-03-14)

  • [#69] Improve console output
  • [#71] Add support for Go language
  • [#72] FIXED: Headroom doctest not passing with hashable-1.3.1.0

0.4.0.0 (released 2021-03-04)

  • [#57] FIXED: put-before/put-after in commented code breaks header detection
  • [#58] BREAKING CHANGE: Extend configuration for defining header margins
  • [#59] Check compatibility of loaded YAML configuration
  • [#61] BREAKING CHANGE: Use regular expressions to specify headers start/end
  • [#62] Sanitize block comment headers with line prefixes
  • [#64] Add command line option for displaying version
  • Bump LTS Haskell to 17.5

0.3.2.0 (released 2020-11-26)

  • [#56] Move CI from Travis to GitHub Actions
  • Minor improvements & bugfixes
  • Bump LTS Haskell to 16.23

0.3.1.0 (released 2020-08-18)

  • [#48] Decouple IO actions for easier testing
  • [#53] Add support for PureScript source code files
  • [#54] Extract dynamic variables from Java source code files
  • Bump LTS Haskell to 16.10

0.3.0.0 (released 2020-06-28)

  • [#25] Extract dynamic variables from Haskell source code files
  • [#29] Add dynamic variable for current year and add support for updating years
  • [#30] Allow workflow without configuration and template files
  • [#49] Microsite for documentation (https://doc.norcane.com/headroom/latest/)
  • [#51] Allow template variable values to be templates itself
  • [#52] Post-processing functions for license headers
  • Various bugfixes and performance improvements
  • Bump LTS Haskell to 16.2

0.2.2.1 (released 2020-05-08)

  • Minor improves in generated .headroom.yaml in init mode

0.2.2.0 (released 2020-05-04)

  • [#45] Add -c|--check-headers command line option
  • Bump LTS Haskell to 15.11

0.2.1.1 (released 2020-04-30)

  • [#47] Make possible to build Headroom with GHC 8.10
  • Remove unused dependency on text package.

0.2.1.0 (released 2020-04-29)

  • [#41] Add --dry-run option to allow test run without changing files.
  • [#44] Don’t touch files whose contents have not changed.
  • [#46] Add -e|--excluded-path=REGEX option to exclude source paths.
  • Bump LTS Haskell to 15.10.
  • Remove unused dependencies.

0.2.0.0 (released 2020-04-25)

  • [#28] Allow license headers to be anywhere in the file, not only at the very beginning.
  • [#31] Render templates for each source file instead of once (blocker for [#25])
  • [#32] Allow custom user configuration for license headers.
  • [#34] Support for Rust
  • [#35] Support for Bash
  • [#36] Support for C/C++
  • [#38] Add -a|--add-headers command-line option
  • bump LTS Haskell to 15.9

0.1.3.0 (released 2020-03-23)

  • [#24] Added Init command that automatically creates initial Headroom configuration and set of templates.
  • bump LTS Haskell to 15.5

0.1.2.0 (released 2020-03-06)

  • FIXED: missing test-data/ folder in dist tarball prevents tests execution
  • bump LTS Haskell to 15.2

0.1.1.0 (released 2020-02-26)

  • FIXED: missing embedded/ folder in dist tarball for Hackage prevents successful build using Cabal
  • bump LTS Haskell to 15.1

0.1.0.0 (released 2020-02-20)

  • initial release