Skip to content

Commit

Permalink
feat(codegen): suggest some hlint rules for generated code
Browse files Browse the repository at this point in the history
Closes #20.
  • Loading branch information
vst committed May 28, 2024
1 parent 9e49390 commit c97aa42
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Postmap/Gencode/Haskell.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ import #{configModuleName}.Identifiers
|]
TIO.writeFile (configOutputIdsModuleFile config) contentIdsModule
TIO.writeFile (configOutputDirectory config <> ".hs") reexportModule
putStrLn "Haskell code generation completed."
putStrLn "Some extensions are used. You may want to use following hlint rule:\n"
let extensions = ["DeriveAnyClass", "DeriveGeneric", "DerivingVia", "DuplicateRecordFields", "FlexibleInstances", "NoImplicitPrelude", "OverloadedStrings", "StandaloneDeriving", "TypeOperators"]
putStrLn "- extensions:"
putStrLn " - default: false # All extension are banned by default."
putStrLn " - name:"
mapM_ (putStrLn . (" - " <>)) extensions
putStrLn "\nYou may also want to use following hlint rule for qualified imports:\n"
putStrLn [i| - { name: #{configModuleName}, as: DB.Model, importStyle: qualified, asRequired: true }|]
putStrLn [i| - { name: #{configModuleName}.**, within: [#{configModuleName}, #{configModuleName}.**] }|]


mkIdsModule :: Config -> [Record] -> T.Text
Expand Down

0 comments on commit c97aa42

Please sign in to comment.