diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Paths.hs | 8 | ||||
-rw-r--r-- | lib/Properties.hs | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/Paths.hs b/lib/Paths.hs index b628ee8..b849cf6 100644 --- a/lib/Paths.hs +++ b/lib/Paths.hs @@ -60,3 +60,11 @@ normalise prefix (Path i path _) = normaliseWithFrag :: FilePath -> RelPath -> FilePath normaliseWithFrag prefix (Path i path frag) = normalise prefix (Path (i+1) path frag) <> T.unpack (maybe mempty ("#" <>) frag) + +-- | does this path contain an old-style pattern for inter-repository +-- links as was used at rc3 in 2020? +isOldStyle :: RelPath -> Bool +isOldStyle (Path _ text frag) = path =~ ("{<.+>*}" :: Text) + where path = case frag of + Just f -> text <> f + _ -> text diff --git a/lib/Properties.hs b/lib/Properties.hs index b15ea15..c278351 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -35,7 +35,7 @@ import LintConfig (LintConfig (..)) import LintWriter (LintWriter, adjust, askContext, askFileDepth, complain, dependsOn, forbid, lintConfig, offersBadge, offersEntrypoint, suggest, warn) -import Paths (PathResult (..), RelPath (..), parsePath) +import Paths (PathResult (..), RelPath (..), parsePath, isOldStyle) import Types (Dep (Link, Local, LocalMap, MapLink)) import Uris (SubstError (..), applySubst) @@ -323,7 +323,10 @@ checkTileLayerProperty p@(Property name _value) = case name of forbidEmptyLayer unwrapURI (Proxy @"map") p (dependsOn . MapLink) - (dependsOn . LocalMap) + (\path -> do + if isOldStyle path + then complain "Old-Style inter-repository links (using {<placeholder>}) cannot be used at rC3 2021; please use world:// instead (cf. howto.rc3.world)." + else dependsOn . LocalMap $ path) "exitSceneUrl" -> deprecatedUseInstead "exitUrl" "exitInstance" -> |