summaryrefslogtreecommitdiff
path: root/lib/LintConfig.hs
diff options
context:
space:
mode:
authorstuebinm2021-11-20 02:30:20 +0100
committerstuebinm2021-11-20 02:30:20 +0100
commit2511c52d9452f60c533871ac111ba9473065310c (patch)
tree9b4fd6a3670841bbfc3f91cc0b2f55b4fc800605 /lib/LintConfig.hs
parent321f4d5fa118515dcde522e1ad01ddd65741828b (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 '')
-rw-r--r--lib/LintConfig.hs11
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