Consistently avoid infix syntax in the GSG and reinstantiate dlint (#5483)

We avoided infix syntax here for `elem` but still used it for
`notElem` which doesn’t make much sense. Also we lost the config to
disable the lint when integrating the example in this repo. This
resulted in our own code producing a lint which is obviously a bad
idea.

side note: I think this lint does make sense once you
are familiar with the syntax and I feel slightly bad about disabling
more and more lints so for now I’m keeping it in the config.

changelog_begin
changelog_end
This commit is contained in:
Moritz Kiefer 2020-04-08 09:40:50 +02:00 committed by GitHub
parent e2a02ca78c
commit 8d56ed3a7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -18,7 +18,7 @@ template User with
controller username
do
assertMsg "You cannot follow yourself" (userToFollow /= username)
assertMsg "You cannot follow the same user twice" (userToFollow `notElem` following)
assertMsg "You cannot follow the same user twice" (notElem userToFollow following)
archive self
create this with following = userToFollow :: following

View File

@ -30,6 +30,16 @@ genrule(
# use default .gitignore and .dlint.yaml if they don't exist in the template
cp -n $$SRC/default-gitignore $$OUT/$$d/.gitignore
cp -n $$SRC/default-dlint-yaml $$OUT/$$d/.dlint.yaml
# We avoid introducing infix syntax in the GSG so we disable
# the lint there.
if [ "$$d" = "create-daml-app" ]; then
cat >> $$OUT/$$d/.dlint.yaml <<EOF
# This rule is enabled by default but we avoid
# infix syntax here to keep things simple.
- ignore: {name: Use infix }
EOF
fi
done
## special cases we should work to remove

View File

@ -21,7 +21,7 @@ template User with
controller username
do
assertMsg "You cannot follow yourself" (userToFollow /= username)
assertMsg "You cannot follow the same user twice" (userToFollow `notElem` following)
assertMsg "You cannot follow the same user twice" (notElem userToFollow following)
archive self
create this with following = userToFollow :: following
-- FOLLOW_END