upenn-cis1xx / camelot

A fully-modular OCaml style linter
https://opam.ocaml.org/packages/camelot/
Apache License 2.0
44 stars 5 forks source link

Narrow @ style violations #82

Open KeenWill opened 3 years ago

KeenWill commented 3 years ago

Styler checker flags (list_of_set lt) @ x @ (list_of_set rt) as

Warning:
    using `@` to prepend an element to a list
You wrote:
     [x] @ (list_of_set rt)
Consider:
    using `::` instead

This is good style though ... Let's keep the style checker from flagging uses of @ lines like this.

sweirich commented 3 years ago

I'd prefer if the style checker did not flag [x] @ xs and tell students to rewrite as x :: xs.

I like to present inorder as (inorder rt) @ [x] @ (inorder rt) to emphasize the symmetry and connection to the other traversals

KeenWill commented 3 years ago

Whoops I had a typo in my comment. It's been updated to say that something of the form list @ [element] @ list is good style that we don't want the style checker to flag (which it currently does).