-
Notifications
You must be signed in to change notification settings - Fork 42
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
Refactoring #141
Refactoring #141
Conversation
It's just down to me now, as @bagp has moved onto an exciting new role elsewhere. I did look at this a while ago but my time is heavily divided. First off, before I get into this, I don't want it to seem too negative and I very much appreciate the time and effort you've put into the PR. Contributions even just of code style or typo fix-ups all help improve code quality and are welcomed. Just your comment typo fixes alone here are great. Thank you for all this. Now, onto the bits I strugged with! I think much of what you've done is personal preference, but is counter to our own preference about coding style (such as parentheses on method calls, which we include often for clarity). Much of our use of such things comes from some 20 or so years now of experience with Rails and Ruby, and seeing what can cause confusion for coders especially less used to Ruby as a language. Wrapping a multi-line "if" condition in parens is another one. Removing Since Scimitar is a hybrid of other work, this coding style is of course not 100% consistent throughout and I realise that in itself might annoy some and can make it hard to judge what is expected! We don't have a coding style doc for the gem, after all. Anyway, this means I'm on the fence. There are some things in here (such as comment typos) that I want to keep. Another one is where you removed the So I guess...
...and some more specific things...
|
@pond Thank you for the reply and: Sorry, this is my first open source contribution on Github 🙏 I should have put the more opinionated code style adjustment in separate PRs to make it easier to review. Putting all changes in one PR makes effort to review much larger than the value the PR is giving.
Regarding the one-liner: self.schemas.lazy.map { |schema| schema.find_attribute(*path) }.find(&:present?)
💡 FYI it doesn't process the whole map, because it uses |
Don't worry, it's a good PR, with a good description and clear intent, and I don't generally mind larger PRs at all. Checks all passed and it looks good -> Merging! Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice tidy-up and useful typo fixes. Thanks!
Why
Hi! 👋 I want to use this Gem for a production system, and I would also like to contribute to this gem in the future.
What
In my first PR here, I did some refactoring and fixed code style issues. Thank you for reviewing 🙏🏻
Details
Scimitar::Resources::Base.find_attribute(*path)
into a one linerThere will be a similar PR for specs later