Is there a straightforward way to add a standard license header (in my specific case, to a Haskell source file)? That is, I'd like to be able to have a comment like
{-
This file is part of My Project
Copyright 2021 Me
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file or at
https://spdx.org/licenses/BSD-3-Clause.html
-}
I tried a couple of hacky ways that have their own tradeoffs:
- Inlining the text in the template (either as a separate comment or as a Haddock source block) causes duplication since
_haskell_module_longdesc greedily consumes everything up to module
- Dumping the text in
_haskell_module_longdesc avoids duplication, but changes to the component variables are (correctly, if unhelpfully in this case) never picked up
I'm not particularly happy with either of those, but I figured I'd see if there was maybe an undocumented footer variable or something that I could co-opt for the purpose.
If this isn't currently possible, I'd likely be interested in putting in some work to get something working. In that event, would you imagine this would be best handled with
- a new
license-headers key (maybe, pre/postamble or footer or something)
- a post-processor
- making
_haskell_module_longdesc less greedy
The last one feels like a scary regex mess waiting to happen, so I'm hopeful one of the other options would be a sensible place to start.
Thanks for Headroom and any input!
Is there a straightforward way to add a standard license header (in my specific case, to a Haskell source file)? That is, I'd like to be able to have a comment like
I tried a couple of hacky ways that have their own tradeoffs:
_haskell_module_longdescgreedily consumes everything up tomodule_haskell_module_longdescavoids duplication, but changes to the component variables are (correctly, if unhelpfully in this case) never picked upI'm not particularly happy with either of those, but I figured I'd see if there was maybe an undocumented footer variable or something that I could co-opt for the purpose.
If this isn't currently possible, I'd likely be interested in putting in some work to get something working. In that event, would you imagine this would be best handled with
license-headerskey (maybe,pre/postambleorfooteror something)_haskell_module_longdescless greedyThe last one feels like a scary regex mess waiting to happen, so I'm hopeful one of the other options would be a sensible place to start.
Thanks for Headroom and any input!