Skip to content
Snippets Groups Projects
Commit ea6ef983 authored by stuebinm's avatar stuebinm
Browse files

add special warning for rc3 old-style links

(the format used last year is no longer applicable to this year's event)
parent b8e3d6ee
No related branches found
No related tags found
No related merge requests found
...@@ -60,3 +60,11 @@ normalise prefix (Path i path _) = ...@@ -60,3 +60,11 @@ normalise prefix (Path i path _) =
normaliseWithFrag :: FilePath -> RelPath -> FilePath normaliseWithFrag :: FilePath -> RelPath -> FilePath
normaliseWithFrag prefix (Path i path frag) = normaliseWithFrag prefix (Path i path frag) =
normalise prefix (Path (i+1) path frag) <> T.unpack (maybe mempty ("#" <>) 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
...@@ -35,7 +35,7 @@ import LintConfig (LintConfig (..)) ...@@ -35,7 +35,7 @@ import LintConfig (LintConfig (..))
import LintWriter (LintWriter, adjust, askContext, askFileDepth, import LintWriter (LintWriter, adjust, askContext, askFileDepth,
complain, dependsOn, forbid, lintConfig, complain, dependsOn, forbid, lintConfig,
offersBadge, offersEntrypoint, suggest, warn) offersBadge, offersEntrypoint, suggest, warn)
import Paths (PathResult (..), RelPath (..), parsePath) import Paths (PathResult (..), RelPath (..), parsePath, isOldStyle)
import Types (Dep (Link, Local, LocalMap, MapLink)) import Types (Dep (Link, Local, LocalMap, MapLink))
import Uris (SubstError (..), applySubst) import Uris (SubstError (..), applySubst)
...@@ -323,7 +323,10 @@ checkTileLayerProperty p@(Property name _value) = case name of ...@@ -323,7 +323,10 @@ checkTileLayerProperty p@(Property name _value) = case name of
forbidEmptyLayer forbidEmptyLayer
unwrapURI (Proxy @"map") p unwrapURI (Proxy @"map") p
(dependsOn . MapLink) (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" -> "exitSceneUrl" ->
deprecatedUseInstead "exitUrl" deprecatedUseInstead "exitUrl"
"exitInstance" -> "exitInstance" ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment