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
2464f639
Commit
2464f639
authored
3 years ago
by
stuebinm
Browse files
Options
Downloads
Patches
Plain Diff
small fixes
parent
c74a9c7f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/CheckDir.hs
+7
-8
7 additions, 8 deletions
lib/CheckDir.hs
with
7 additions
and
8 deletions
lib/CheckDir.hs
+
7
−
8
View file @
2464f639
...
...
@@ -62,12 +62,11 @@ newtype MissingAsset = MissingAsset MissingDep
resultIsFatal
::
LintConfig'
->
DirResult
->
Bool
resultIsFatal
config
res
=
(
not
(
null
(
dirresultMissingAssets
res
))
)
&&
(
configMaxLintLevel
config
)
<=
maxObservedLevel
not
(
null
(
dirresultMissingAssets
res
))
&&
configMaxLintLevel
config
<=
maxObservedLevel
where
maxObservedLevel
=
maximum
.
map
hintLevel
.
concatMap
keys
.
map
mapresultLayer
.
concatMap
(
keys
.
mapresultLayer
)
.
elems
.
dirresultMaps
$
res
...
...
@@ -134,16 +133,16 @@ recursiveCheckDir :: LintConfig' -> FilePath -> FilePath -> IO DirResult
recursiveCheckDir
config
prefix
root
=
do
linted
<-
recursiveCheckDir'
config
prefix
[
root
]
mempty
mempty
mAssets
<-
missingAssets
prefix
linted
pure
$
linted
<>
mempty
{
dirresultDeps
=
missingDeps
linted
pure
$
linted
<>
mempty
{
dirresultDeps
=
missingDeps
root
linted
,
dirresultMissingAssets
=
mAssets
}
-- | Given a (partially) completed DirResult, check which local
-- maps are referenced but do not actually exist.
missingDeps
::
DirResult
->
[
MissingDep
]
missingDeps
res
=
let
simple
=
M
.
insert
"main.json"
[]
used
\\
M
.
union
defined
trivial
missingDeps
::
FilePath
->
DirResult
->
[
MissingDep
]
missingDeps
entrypoint
res
=
let
simple
=
M
.
insert
(
T
.
pack
entrypoint
)
[]
used
\\
M
.
union
defined
trivial
in
M
.
foldMapWithKey
(
\
f
n
->
[
MissingDep
f
n
])
simple
where
-- which maps are linked somewhere?
...
...
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