neo4j/neo4j-documentation

UNWIND formatting is missing whitespaces

szarnyasg opened this issue · 2 comments

I noticed some minor formatting irregularities:

Unwind a list:

UNWIND[1,2,3] AS x
RETURN x
  1. There is a space missing between UNWIND and [1,2,3].

Create a distinct list:

WITH [1,1,2,2] AS coll UNWIND coll AS x
WITH DISTINCT x
RETURN collect(x) AS SET
  1. There is a newline missing before UNWIND.

I cloned the repository and tried to fix the queries in UnwindTest.scala, but it seems that the Cypher code snippets are autoformatted and the issue is caused by the formatter.

Can you please give me a pointer to where the formatting happens?

Hi

Thanks for alerting us to this bug - we'll look into it as soon as we can.

@szarnyasg there is now a PR to fix the fact that UNWIND doesn't begin on a new line.

The code that formats Cypher is 'Prettifier.scala', which you can see in the PR.

It is quite obvious, though, that much more needs to be done with the prettifier to bring it up to date with the Cypher style guide. We'll schedule this in as future work, time allowing.

Thanks again for bringing this to our attention.