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
856a86b8
Unverified
Commit
856a86b8
authored
3 years ago
by
stuebinm
Browse files
Options
Downloads
Patches
Plain Diff
readable prettyprint for inverted lint output
the previous state was a hacky mess
parent
34c19495
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/CheckMap.hs
+2
-1
2 additions, 1 deletion
lib/CheckMap.hs
lib/Types.hs
+3
-0
3 additions, 0 deletions
lib/Types.hs
with
5 additions
and
1 deletion
lib/CheckMap.hs
+
2
−
1
View file @
856a86b8
...
@@ -124,7 +124,8 @@ instance PrettyPrint (Level, MapResult) where
...
@@ -124,7 +124,8 @@ instance PrettyPrint (Level, MapResult) where
-- TODO: this can be simplified further
-- TODO: this can be simplified further
prettyLayer
::
[
Text
]
prettyLayer
::
[
Text
]
prettyLayer
=
mapMaybe
prettyLayer
=
mapMaybe
(
\
(
_
,
l
)
->
Just
$
{-prettyprint level <> -}
(
T
.
concat
$
fmap
prettyprint
$
fmap
getName
l
))
(
\
(
hint
,
layer
)
->
Just
$
prettyprint
hint
<>
"
\n
(in "
<>
T
.
intercalate
", "
(
fmap
getName
layer
)
<>
")
\n
"
)
(
toList
.
mapresultLayer
$
mapResult
)
(
toList
.
mapresultLayer
$
mapResult
)
prettyTileset
::
[
Text
]
prettyTileset
::
[
Text
]
prettyTileset
=
mapMaybe
prettyTileset
=
mapMaybe
...
...
This diff is collapsed.
Click to expand it.
lib/Types.hs
+
3
−
0
View file @
856a86b8
...
@@ -79,6 +79,9 @@ instance PrettyPrint Lint where
...
@@ -79,6 +79,9 @@ instance PrettyPrint Lint where
prettyprint
(
Offers
dep
)
=
prettyprint
(
Offers
dep
)
=
" Info: map offers entrypoint "
<>
prettyprint
dep
" Info: map offers entrypoint "
<>
prettyprint
dep
instance
PrettyPrint
Hint
where
prettyprint
(
Hint
level
msg
)
=
" "
<>
(
showText
level
)
<>
": "
<>
msg
instance
ToJSON
Lint
where
instance
ToJSON
Lint
where
toJSON
(
Lint
(
Hint
l
m
))
=
A
.
object
toJSON
(
Lint
(
Hint
l
m
))
=
A
.
object
[
"msg"
.=
m
,
"level"
.=
l
]
[
"msg"
.=
m
,
"level"
.=
l
]
...
...
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