Skip to content

Commit

Permalink
v2 / Minor: fix linting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
aseemk committed Mar 28, 2016
1 parent 701a0bb commit 037e62a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
5 changes: 5 additions & 0 deletions lib-new/Transaction.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ module.exports = class Transaction
# Convenience helper for nice getter syntax:
# (NOTE: This does *not* support sibling setters, as we don't need it,
# but it's possible to add support.)
#
# NOTE: CoffeeLint thinks this fat arrow is unnecessary here, but it's not:
# https://github.com/clutchski/coffeelint/issues/555
# coffeelint: disable=no_private_function_fat_arrows
#
get = (props) =>
for name, getter of props
Object.defineProperty @::, name,
Expand Down
21 changes: 7 additions & 14 deletions test-new/transactions._coffee
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ describe 'Transactions', ->

{labels, properties} = fixtures.createTestNode module, _

# Add a random property so it's easier to look for it below:
properties.test = "should isolate effects #{helpers.getRandomStr()}"

[{node}] = tx.cypher
query: """
CREATE (node:#{TEST_LABEL} {properties})
Expand All @@ -145,22 +148,12 @@ describe 'Transactions', ->
results = DB.cypher
query: """
MATCH (node:#{TEST_LABEL})
WHERE #{(
# NOTE: Cypher doesn’t support directly comparing nodes and
# property bags, so we have to compare each property.
# HACK: CoffeeLint thinks the below is bad indentation.
# https://github.com/clutchski/coffeelint/issues/456
# coffeelint: disable=indentation
for prop of properties
"node.#{prop} = {properties}.#{prop}"
# coffeelint: enable=indentation
# HACK: CoffeeLint also thinks the below is double quotes!
# https://github.com/clutchski/coffeelint/issues/368
# coffeelint: disable=no_unnecessary_double_quotes
).join ' AND '}
// NOTE: Cypher doesn't support comparing a node or relationship
// to an entire map of properties, so we check just the one
// random one we created above:
WHERE node.test = {properties}.test
RETURN node
"""
# coffeelint: enable=no_unnecessary_double_quotes
params: {properties}
, _

Expand Down

0 comments on commit 037e62a

Please sign in to comment.