You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.
()-less comprehensions and {}-less object literals can interact to form more ambiguous scenarios than are currently flagged by ensure_comprehensions.
Strings like this…
fish: f for f in ['albacore', 'bass', 'carp']
…can have different meanings depending where parentheses or braces are added:
# [ { fish: 'albacore' }, { fish: 'bass' }, { fish: 'carp' } ]
(fish: f) for f in ['albacore', 'bass', 'carp']
{fish: f} for f in ['albacore', 'bass', 'carp']
# { fish: [ 'albacore', 'bass', 'carp' ] }fish: (f for f in ['albacore', 'bass', 'carp'])
{fish: f for f in ['albacore', 'bass', 'carp']}
This can arise in function arguments, function results, and nested object literals:
# should warnsetPuddleContentsfish: f for f in ['albacore', 'bass', 'carp']
setPuddleContents(fish: f for f in ['albacore', 'bass', 'carp'])
setPuddleContents
fish: f for f in ['albacore', 'bass', 'carp']
# unambiguous
(setPuddleContentsfish: f) for f in ['albacore', 'bass', 'carp']
setPuddleContents(fish: f) for f in ['albacore', 'bass', 'carp']
setPuddleContentsfish: (f for f in ['albacore', 'bass', 'carp'])
setPuddleContents {fish: f for f in ['albacore', 'bass', 'carp']}
setPuddleContents
{fish: f} for f in ['albacore', 'bass', 'carp']
setPuddleContents
fish: (f for f in ['albacore', 'bass', 'carp'])
# should warngetPuddleContents=->fish: f for f in ['albacore', 'bass', 'carp']
getPuddleContents=-> (fish: f for f in ['albacore', 'bass', 'carp'])
# unambiguous
(getPuddleContents=->fish: f) for f in ['albacore', 'bass', 'carp']
getPuddleContents=-> ({fish: f} for f in ['albacore', 'bass', 'carp'])
getPuddleContents=->
{fish: f} for f in ['albacore', 'bass', 'carp']
getPuddleContents=->fish: (f for f in ['albacore', 'bass', 'carp'])
getPuddleContents=-> {fish: f for f in ['albacore', 'bass', 'carp']}
# should warnpuddleContents:fish: f for f in ['albacore', 'bass', 'carp']
# unambiguous
{puddleContents:fish: f} for f in ['albacore', 'bass', 'carp']
puddleContents: {fish: f for f in ['albacore', 'bass', 'carp']}
puddleContents:fish: (f for f in ['albacore', 'bass', 'carp'])
puddleContents: ({fish: f} for f in ['albacore', 'bass', 'carp'])
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
()
-less comprehensions and{}
-less object literals can interact to form more ambiguous scenarios than are currently flagged byensure_comprehensions
.Strings like this…
…can have different meanings depending where parentheses or braces are added:
This can arise in function arguments, function results, and nested object literals:
The text was updated successfully, but these errors were encountered: