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
2ffe0630
Commit
2ffe0630
authored
3 years ago
by
Sven G. Brönstrup
Browse files
Options
Downloads
Patches
Plain Diff
Did some of the desired changes
parent
c0685792
Branches
Branches containing commit
No related tags found
1 merge request
!1
Extended scripts support
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Properties.hs
+10
-7
10 additions, 7 deletions
lib/Properties.hs
with
10 additions
and
7 deletions
lib/Properties.hs
+
10
−
7
View file @
2ffe0630
...
@@ -228,9 +228,12 @@ checkLayer = do
...
@@ -228,9 +228,12 @@ checkLayer = do
checkObjectProperty
::
Object
->
Property
->
LintWriter
Layer
checkObjectProperty
::
Object
->
Property
->
LintWriter
Layer
checkObjectProperty
obj
p
@
(
Property
name
_
)
=
case
name
of
checkObjectProperty
obj
p
@
(
Property
name
_
)
=
case
name
of
"url"
->
do
"url"
->
do
unwrapURI
(
Proxy
@
"website"
)
p
unwrapURI
'
(
Proxy
@
"website"
)
p
(
dependsOn
.
Link
)
(
dependsOn
.
Link
)
(
const
$
forbid
"using
\"
url
\"
to open local html files is disallowed."
)
(
const
$
forbid
"using
\"
url
\"
to open local html files is disallowed."
)
-- | TODO: The uri should be rewritten if the unwrapURI' did add the wrapper
unless
(
objectType
obj
==
"website"
)
unless
(
objectType
obj
==
"website"
)
$
complain
"
\"
url
\"
can only be set for objects of type
\"
website
\"
"
$
complain
"
\"
url
\"
can only be set for objects of type
\"
website
\"
"
"allowApi"
->
forbidProperty
name
"allowApi"
->
forbidProperty
name
...
@@ -257,7 +260,7 @@ checkObjectProperty obj p@(Property name _) = case name of
...
@@ -257,7 +260,7 @@ checkObjectProperty obj p@(Property name _) = case name of
"door"
->
do
"door"
->
do
isBool
p
isBool
p
unless
(
objectType
obj
==
"variable"
)
$
unless
(
objectType
obj
==
"variable"
)
$
complain
"
Door variables must be
of type
\"
variable
\"
"
complain
"
the
\"
door
\"
property should only be set on objects
of type
\"
variable
\"
"
when
(
null
(
objectName
obj
)
||
objectName
obj
==
Just
mempty
)
$
when
(
null
(
objectName
obj
)
||
objectName
obj
==
Just
mempty
)
$
complain
"Door variables objects must have a name given"
complain
"Door variables objects must have a name given"
...
@@ -276,7 +279,7 @@ checkObjectProperty obj p@(Property name _) = case name of
...
@@ -276,7 +279,7 @@ checkObjectProperty obj p@(Property name _) = case name of
"openSound"
->
do
"openSound"
->
do
isString
p
isString
p
unwrapURI
(
Proxy
@
"audio"
)
p
unwrapURI
'
(
Proxy
@
"audio"
)
p
(
dependsOn
.
Link
)
(
dependsOn
.
Link
)
(
dependsOn
.
Local
)
(
dependsOn
.
Local
)
...
@@ -287,7 +290,7 @@ checkObjectProperty obj p@(Property name _) = case name of
...
@@ -287,7 +290,7 @@ checkObjectProperty obj p@(Property name _) = case name of
"closeSound"
->
do
"closeSound"
->
do
isString
p
isString
p
unwrapURI
(
Proxy
@
"audio"
)
p
unwrapURI
'
(
Proxy
@
"audio"
)
p
(
dependsOn
.
Link
)
(
dependsOn
.
Link
)
(
dependsOn
.
Local
)
(
dependsOn
.
Local
)
...
@@ -302,13 +305,13 @@ checkObjectProperty obj p@(Property name _) = case name of
...
@@ -302,13 +305,13 @@ checkObjectProperty obj p@(Property name _) = case name of
"bell"
->
do
"bell"
->
do
isBool
p
isBool
p
unless
(
objectType
obj
==
"variable"
)
$
unless
(
objectType
obj
==
"variable"
)
$
complain
"
Bell variables must be
of type
\"
variable
\"
"
complain
"
the
\"
bell
\"
property should only be set on objects
of type
\"
variable
\"
"
when
(
null
(
objectName
obj
)
||
objectName
obj
==
Just
mempty
)
$
when
(
null
(
objectName
obj
)
||
objectName
obj
==
Just
mempty
)
$
complain
"Bell variables objects must have a name given"
complain
"Bell variables objects must have a name given"
"bellSound"
->
do
"bellSound"
->
do
isString
p
isString
p
unwrapURI
(
Proxy
@
"audio"
)
p
unwrapURI
'
(
Proxy
@
"audio"
)
p
(
dependsOn
.
Link
)
(
dependsOn
.
Link
)
(
dependsOn
.
Local
)
(
dependsOn
.
Local
)
...
@@ -317,7 +320,7 @@ checkObjectProperty obj p@(Property name _) = case name of
...
@@ -317,7 +320,7 @@ checkObjectProperty obj p@(Property name _) = case name of
-- | Applies to doors and bells as well
-- | Applies to doors and bells as well
"soundRadius"
->
do
"soundRadius"
->
do
isInt
p
isInt
p
--
requireAnyProperty "door" "bell"
--
| maybe we should lint that this property is only used on door and bell variables
_
->
warn
$
"unknown object property "
<>
prettyprint
name
<>
"."
_
->
warn
$
"unknown object property "
<>
prettyprint
name
<>
"."
...
...
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