mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
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:
parent
e2a02ca78c
commit
8d56ed3a7e
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user