Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
walint
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
hub
walint
Commits
204d3f4a
Commit
204d3f4a
authored
3 years ago
by
stuebinm
Browse files
Options
Downloads
Patches
Plain Diff
complain if map links that don't go to .json files
parent
ea6ef983
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Paths.hs
+6
-0
6 additions, 0 deletions
lib/Paths.hs
lib/Properties.hs
+14
-6
14 additions, 6 deletions
lib/Properties.hs
with
20 additions
and
6 deletions
lib/Paths.hs
+
6
−
0
View file @
204d3f4a
...
@@ -68,3 +68,9 @@ isOldStyle (Path _ text frag) = path =~ ("{<.+>*}" :: Text)
...
@@ -68,3 +68,9 @@ isOldStyle (Path _ text frag) = path =~ ("{<.+>*}" :: Text)
where
path
=
case
frag
of
where
path
=
case
frag
of
Just
f
->
text
<>
f
Just
f
->
text
<>
f
_
->
text
_
->
text
getExtension
::
RelPath
->
Text
getExtension
(
Path
_
text
frag
)
=
case
length
splitted
of
0
->
""
_
->
last
splitted
where
splitted
=
T
.
splitOn
"."
text
This diff is collapsed.
Click to expand it.
lib/Properties.hs
+
14
−
6
View file @
204d3f4a
...
@@ -11,7 +11,7 @@ module Properties (checkMap, checkTileset, checkLayer) where
...
@@ -11,7 +11,7 @@ module Properties (checkMap, checkTileset, checkLayer) where
import
Control.Monad
(
forM_
,
unless
,
when
)
import
Control.Monad
(
forM_
,
unless
,
when
)
import
Data.Text
(
Text
,
i
sPrefixOf
,
intercalate
)
import
Data.Text
(
Text
,
i
ntercalate
,
isPrefixOf
)
import
qualified
Data.Vector
as
V
import
qualified
Data.Vector
as
V
import
Tiled
(
Layer
(
..
),
Object
(
..
),
Property
(
..
),
import
Tiled
(
Layer
(
..
),
Object
(
..
),
Property
(
..
),
PropertyValue
(
..
),
Tile
(
..
),
Tiledmap
(
..
),
PropertyValue
(
..
),
Tile
(
..
),
Tiledmap
(
..
),
...
@@ -35,7 +35,8 @@ import LintConfig (LintConfig (..))
...
@@ -35,7 +35,8 @@ 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
,
isOldStyle
)
import
Paths
(
PathResult
(
..
),
RelPath
(
..
),
getExtension
,
isOldStyle
,
parsePath
)
import
Types
(
Dep
(
Link
,
Local
,
LocalMap
,
MapLink
))
import
Types
(
Dep
(
Link
,
Local
,
LocalMap
,
MapLink
))
import
Uris
(
SubstError
(
..
),
applySubst
)
import
Uris
(
SubstError
(
..
),
applySubst
)
...
@@ -323,10 +324,17 @@ checkTileLayerProperty p@(Property name _value) = case name of
...
@@ -323,10 +324,17 @@ checkTileLayerProperty p@(Property name _value) = case name of
forbidEmptyLayer
forbidEmptyLayer
unwrapURI
(
Proxy
@
"map"
)
p
unwrapURI
(
Proxy
@
"map"
)
p
(
dependsOn
.
MapLink
)
(
dependsOn
.
MapLink
)
(
\
path
->
do
$
\
path
->
if
isOldStyle
path
let
ext
=
getExtension
path
in
then
complain
"Old-Style inter-repository links (using {<placeholder>}) cannot be used at rC3 2021; please use world:// instead (cf. howto.rc3.world)."
if
|
isOldStyle
path
->
else
dependsOn
.
LocalMap
$
path
)
complain
"Old-Style inter-repository links (using {<placeholder>})
\
\
cannot be used at rC3 2021; please use world:// instead
\
\
(cf. howto.rc3.world)."
|
ext
==
"tmx"
->
complain
"Cannot use .tmx map format; use Tiled's json export instead."
|
ext
/=
"json"
->
complain
"All exit links must link to .json files."
|
otherwise
->
dependsOn
.
LocalMap
$
path
"exitSceneUrl"
->
"exitSceneUrl"
->
deprecatedUseInstead
"exitUrl"
deprecatedUseInstead
"exitUrl"
"exitInstance"
->
"exitInstance"
->
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment