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
62916338
Commit
62916338
authored
3 years ago
by
stuebinm
Browse files
Options
Downloads
Patches
Plain Diff
little code cleanup
parent
652c2030
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/CheckMap.hs
+5
-7
5 additions, 7 deletions
lib/CheckMap.hs
lib/Properties.hs
+1
-1
1 addition, 1 deletion
lib/Properties.hs
with
6 additions
and
8 deletions
lib/CheckMap.hs
+
5
−
7
View file @
62916338
...
@@ -89,7 +89,7 @@ runLinter :: Tiledmap -> Int -> MapResult
...
@@ -89,7 +89,7 @@ runLinter :: Tiledmap -> Int -> MapResult
runLinter
tiledmap
depth
=
MapResult
runLinter
tiledmap
depth
=
MapResult
{
mapresultLayer
=
invertThing
layer
{
mapresultLayer
=
invertThing
layer
,
mapresultTileset
=
invertThing
tileset
,
mapresultTileset
=
invertThing
tileset
,
mapresultGeneral
=
general
Lints
,
mapresultGeneral
=
resultToLints
general
Result
,
mapresultDepends
=
mapMaybe
lintToDep
generalLints
,
mapresultDepends
=
mapMaybe
lintToDep
generalLints
<>
concatMap
resultToDeps
layer
<>
concatMap
resultToDeps
layer
<>
concatMap
resultToDeps
tileset
<>
concatMap
resultToDeps
tileset
...
@@ -99,6 +99,7 @@ runLinter tiledmap depth = MapResult
...
@@ -99,6 +99,7 @@ runLinter tiledmap depth = MapResult
where
where
layer
=
checkThing
tiledmapLayers
checkLayer
layer
=
checkThing
tiledmapLayers
checkLayer
tileset
=
checkThing
tiledmapTilesets
checkTileset
tileset
=
checkThing
tiledmapTilesets
checkTileset
generalResult
=
runLintWriter
tiledmap
depth
checkMap
checkThing
getter
checker
=
V
.
toList
.
V
.
map
runCheck
$
getter
tiledmap
checkThing
getter
checker
=
V
.
toList
.
V
.
map
runCheck
$
getter
tiledmap
where
runCheck
thing
=
runLintWriter
thing
depth
checker
where
runCheck
thing
=
runLintWriter
thing
depth
checker
...
@@ -106,15 +107,12 @@ runLinter tiledmap depth = MapResult
...
@@ -106,15 +107,12 @@ runLinter tiledmap depth = MapResult
-- | "inverts" a LintResult, i.e. groups it by lints instead of
-- | "inverts" a LintResult, i.e. groups it by lints instead of
-- layers / maps
-- layers / maps
invertThing
thing
=
M
.
unionsWith
(
<>
)
$
fmap
invertLintResult
thing
invertThing
thing
=
M
.
unionsWith
(
<>
)
$
fmap
invertLintResult
thing
-- lints collected from properties
generalLints
=
resultToLints
generalResult
generalResult
=
runLintWriter
tiledmap
depth
checkMap
adjustedMap
=
(
resultToAdjusted
generalResult
)
adjustedMap
=
(
resultToAdjusted
generalResult
)
{
tiledmapLayers
=
V
.
fromList
.
fmap
resultToAdjusted
$
layer
}
{
tiledmapLayers
=
V
.
fromList
.
fmap
resultToAdjusted
$
layer
-- TODO: this appears to have reordered map layers???
,
tiledmapTilesets
=
V
.
fromList
.
fmap
resultToAdjusted
$
tileset
}
-- human-readable lint output, e.g. for consoles
-- human-readable lint output, e.g. for consoles
instance
PrettyPrint
(
Level
,
MapResult
)
where
instance
PrettyPrint
(
Level
,
MapResult
)
where
...
...
This diff is collapsed.
Click to expand it.
lib/Properties.hs
+
1
−
1
View file @
62916338
...
@@ -98,7 +98,6 @@ checkLayer :: LintWriter Layer
...
@@ -98,7 +98,6 @@ checkLayer :: LintWriter Layer
checkLayer
=
do
checkLayer
=
do
layer
<-
askContext
layer
<-
askContext
mapM_
checkLayerProperty
(
getProperties
layer
)
mapM_
checkLayerProperty
(
getProperties
layer
)
setProperty
"jitsiRoomAdminTag"
"Hello, World"
...
@@ -109,6 +108,7 @@ checkLayer = do
...
@@ -109,6 +108,7 @@ checkLayer = do
checkLayerProperty
::
Property
->
LintWriter
Layer
checkLayerProperty
::
Property
->
LintWriter
Layer
checkLayerProperty
p
@
(
Property
name
_value
)
=
case
name
of
checkLayerProperty
p
@
(
Property
name
_value
)
=
case
name
of
"jitsiRoom"
->
do
"jitsiRoom"
->
do
setProperty
"jitsiRoomAdminTag"
"Hello, World"
uselessEmptyLayer
uselessEmptyLayer
unwrapString
p
$
\
_val
->
do
unwrapString
p
$
\
_val
->
do
suggestProperty
$
Property
"jitsiTrigger"
(
StrProp
"onaction"
)
suggestProperty
$
Property
"jitsiTrigger"
(
StrProp
"onaction"
)
...
...
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