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

Add a NimbleOperatorRule #881

Closed
marcelofabri opened this issue Nov 20, 2016 · 2 comments · Fixed by #899
Closed

Add a NimbleOperatorRule #881

marcelofabri opened this issue Nov 20, 2016 · 2 comments · Fixed by #899

Comments

@marcelofabri
Copy link
Collaborator

We use Nimble on our unit tests, and we prefer using its operator overloads instead of functions:

// triggers
expect(seagull.squawk).toNot(equal("Hi"))
expect(10).to(beGreaterThan(2))

// doesn't trigger
expect(seagull.squawk) != "Hi!"
expect(10) > 2

Creating a rule to enforce this shouldn't be too hard. However, even if it's opt-in I know it's a very specific use case. Would this be a welcome rule addition?

@wongzigii
Copy link

wongzigii commented Nov 20, 2016

@marcelofabri

Linting Nimble's library code with comma rule will result in :

// before
expect([1,2,3,4]).to(allPass({$0 < 5}))

// after
expect([1, 2,3, 4]).to(allPass({$0 < 5}))

Is this an expected behavior?

@marcelofabri
Copy link
Collaborator Author

I'm not sure how this is related to this issue, but it seems it's a consequence of #872 with autocorrect.

jpsim pushed a commit that referenced this issue Nov 25, 2016
jpsim pushed a commit that referenced this issue Nov 25, 2016
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

Successfully merging a pull request may close this issue.

2 participants