Skip to content

Commit

Permalink
Handle SPDX licences starting with a digit
Browse files Browse the repository at this point in the history
  • Loading branch information
ffaf1 committed Sep 12, 2024
1 parent 1077091 commit 573e5b6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cabal-dev-scripts/src/GenUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Data.Text (Text)
import GHC.Generics (Generic)

import qualified Data.Algorithm.Diff as Diff
import qualified Data.Char as C
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.Text as T
Expand Down Expand Up @@ -160,9 +161,11 @@ toConstructorName t = t
f c = c

special :: Text -> Text
special "0BSD" = "NullBSD"
special "389_exception" = "DS389_exception"
special u = u
-- Handle licences starting with a digit.
special u
| Just (c, _) <- T.uncons u
, C.isDigit c = "NN_" <> u
special u = u

mkList :: [Text] -> Text
mkList [] = " []"
Expand Down

0 comments on commit 573e5b6

Please sign in to comment.