From 2c20cd6d62de70faf093009997c3fecf1d50f6d6 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 5 Oct 2022 14:17:07 -0700 Subject: [PATCH] fix(STYLEGUIDE.md): remove extra opening code block In the `Keyword Arguments` section, there's an example that presents two code blocks. This change removes a lone opening code block without its matching end and adjusts the accompanying prose for readability. --- STYLEGUIDE.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index b10d59c3..c32650c4 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -418,9 +418,8 @@ hsh = { [Keyword arguments](http://magazine.rubyist.net/?Ruby200SpecialEn-kwarg) are recommended but not required when a method's arguments may otherwise be opaque or non-obvious when called. Additionally, prefer them over the old "Hash as pseudo-named args" style from pre-2.0 ruby. [[link](#keyword-arguments)] -``` ruby - So instead of this: + ``` ruby def remove_member(user, skip_membership_check=false) # ... @@ -430,7 +429,8 @@ end remove_member(user, true) ``` -Do this, which is much clearer. +Do this, which is much clearer: + ``` ruby def remove_member(user, skip_membership_check: false) # ... @@ -893,4 +893,4 @@ result = hash.map { |_, v| v + 1 } Refactoring is even better. It's worth looking hard at any code that explicitly checks types. -[rubocop-guide]: https://github.com/rubocop-hq/ruby-style-guide \ No newline at end of file +[rubocop-guide]: https://github.com/rubocop-hq/ruby-style-guide