diff options
author | stuebinm | 2021-11-20 02:30:20 +0100 |
---|---|---|
committer | stuebinm | 2021-11-20 02:30:20 +0100 |
commit | 2511c52d9452f60c533871ac111ba9473065310c (patch) | |
tree | 9b4fd6a3670841bbfc3f91cc0b2f55b4fc800605 /lib/LintConfig.hs | |
parent | 321f4d5fa118515dcde522e1ad01ddd65741828b (diff) |
make link adjustments configurable
this allows for creating custom URI "schemas" in the linter's config,
which may be either allowed, prefixed, or translated according to
some (domain-based) substitution.
Diffstat (limited to 'lib/LintConfig.hs')
-rw-r--r-- | lib/LintConfig.hs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/LintConfig.hs b/lib/LintConfig.hs index d976352..f540ae1 100644 --- a/lib/LintConfig.hs +++ b/lib/LintConfig.hs @@ -21,10 +21,10 @@ import Data.Text (Text) import GHC.Generics (Generic (Rep, from, to), K1 (..), M1 (..), (:*:) (..)) import Types (Level) +import Uris (SchemaSet) import WithCli (Proxy (..)) import WithCli.Pure (Argument (argumentType, parseArgument)) - type family HKD f a where HKD Identity a = a HKD f a = f a @@ -40,12 +40,7 @@ data LintConfig f = LintConfig -- ^ Don't copy map assets (mostly useful for development) , configAllowScripts :: HKD f Bool -- ^ Allow defining custom scripts in maps - , configLinkPrefix :: HKD f Text - -- ^ prefix that will be added to all outgoing weblinks - , configAllowedDomains :: HKD f [Text] - -- ^ domains that are allowed in weblinks and will not be modified - , configBlockedDomains :: HKD f [Text] - -- ^ domains that are blocked; weblinks to these is an error + , configUriSchemas :: HKD f SchemaSet } deriving (Generic) type LintConfig' = LintConfig Identity @@ -57,6 +52,7 @@ deriving instance , Show (HKD a Level) , Show (HKD a [Text]) , Show (HKD a Bool) + , Show (HKD a SchemaSet) ) => Show (LintConfig a) @@ -73,6 +69,7 @@ instance , FromJSON (HKD a Text) , FromJSON (HKD a Level) , FromJSON (HKD a Bool) + , FromJSON (HKD a SchemaSet) ) => FromJSON (LintConfig a) where |