Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensuring that the second argument to is resides in its own line #257

Open
vemv opened this issue Aug 19, 2022 · 3 comments
Open

Ensuring that the second argument to is resides in its own line #257

vemv opened this issue Aug 19, 2022 · 3 comments

Comments

@vemv
Copy link
Contributor

vemv commented Aug 19, 2022

This is one little rule that would be part of Semantic. Probably an easy one:

The second argument of clojure.test/is, if provided, should reside in its own line.

(is (cool? 42)
    "Is very cool")

The intent is to make it super clear that "Is very cool" is not part of the assertion. That can easily become non-obvious over Github code reviews, where one doesn't have paren matching at hand.

"A second argument has to reside in its own line" might be equivalent to "a newline must be placed after the first argument". We already have a few rules similar to "a newline must be placed after the first argument" so this might be super easy.

The only thing I'm not sure about is whether current tech handles such optional arguments gracefully.

Thanks - V

@kkinnear
Copy link
Owner

I think this is probably pretty easy, but I'm unsure of what you mean by your last statement about "handles such optional arguments gracefully". If you want to give me a couple of examples of what you want to see with (or without) the "optional arguments", I hope to be able to give you a solid solution to this.

kkinnear added a commit that referenced this issue Aug 23, 2022
@kkinnear
Copy link
Owner

I have added is to the function map as part of :s1.9 and therefore also :sall, so that the third argument will never show up on the same line as the first and second. I expect that this is what you wanted. Give it a try, and if it isn't right, let me know. This is also in the recent push to GitHub for semantic2 that I discussed in #254.

kkinnear added a commit that referenced this issue Sep 15, 2022
kkinnear added a commit that referenced this issue Jan 23, 2023
@kkinnear
Copy link
Owner

Also in 1.2.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants