dry-rb / dry-logic

Predicate logic with rule composition
https://dry-rb.org/gems/dry-logic/
MIT License
179 stars 66 forks source link

fix some style / warnings #19

Closed joevandyk closed 7 years ago

joevandyk commented 8 years ago

not sure if these sorts of things are valuable.. I like to try to follow the ruby style guide when possible. does dry-rb have a defined style guide?

fran-worley commented 8 years ago

Is there a reason why you've replaced all cases of .() with .call() ?

joevandyk commented 8 years ago

https://github.com/bbatsov/ruby-style-guide#proc-call

fran-worley commented 8 years ago

I'm happy with all the changes except that one.

If you replace .() with .call() here then for consistency you ought to do it in the other libs. I get that standards are supposed to replace personal preferences but now I get what .() does I'm quite attached.

@solnic what are your thoughts?

fran-worley commented 8 years ago

@joevandyk I think you've got raise and fail the wrong way around: https://github.com/bbatsov/ruby-style-guide#exceptions

Looks like it should be raise over fail (i.e. how it was).

solnic commented 8 years ago

Please don't change .() to call, I like to use it in places where it's a call w/o side-effects, and it's shorter.

solnic commented 8 years ago

We use rubocop on CodeClimate but there's no official dry-rb style guide (yet). We definitely use a slightly different style so I guess we should document it somewhere. I'm happy to merge this in assuming you're OK with fixing the things I mentioned in my comments :) Thank you.

joevandyk commented 8 years ago

I'll close this.. perhaps there could be an official dry-rb rubocop config shared between the projects?

solnic commented 8 years ago

We can think about a common config and using either CodeClimate or rubocop on CI but I wouldn't want to maintain it, so 👎 unless we have people who are willing to do this kind of work.