Skip to content

Commit d7bd2d1

Browse files
committed
link rubocop guideline to additional information
1 parent e13bfab commit d7bd2d1

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

.markdownlint-cli2.jsonc

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149

150150
/* MD052 - Reference links and images should use a label that is defined */
151151
"reference-links-images": {
152-
"shortcut_syntax": true
152+
"shortcut_syntax": false
153153
},
154154

155155
/* MD053 - Link and image reference definitions should be needed */

ruby/README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
[Sample 1](sample_1.rb) [Sample 2](sample_2.rb)
44

5-
- Use an opinionated set of rules for Rubocop. Prefer [standard] for new projects.
6-
- Having an already decided configuration removes bikeshedding on what a Rubocop configuration should be.
5+
- [Use an opinionated set of rules for Rubocop](./Use an opinionated set of rules for Rubocop.md)
76
- Avoid conditional modifiers (lines that end with conditionals). [36491dbb9]
87
- Avoid multiple assignments per line (`one, two = 1, 2`). [#109]
98
- Avoid organizational comments (`# Validations`). [#63]
@@ -42,7 +41,6 @@
4241
- Prefer `private` when indicating scope. Use `protected` only with comparison
4342
methods like `def ==(other)`, `def <(other)`, and `def >(other)`.
4443

45-
[standard]: https://github.com/testdouble/standard
4644
[#63]: https://github.com/thoughtbot/guides/pull/63
4745
[#109]: https://github.com/thoughtbot/guides/pull/109
4846
[#122]: https://github.com/thoughtbot/guides/pull/122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Use an opinionated set of rules for Rubocop
2+
3+
Ruby code can be written in many different styles and still be syntatically correct. The presence of divergent style and
4+
format can disrupt communication as well as complicate feature development. Code that exhibits a consistent style is
5+
easier to understand and maintain. The absence of consistent enforced style can result in unnessary code churn.
6+
7+
**Therefore:** Use an opinionated set of rules for Rubocop when coding in Ruby. Prefer [standard] for new projects.
8+
9+
- By employing an already decided configuration, you avoid bikeshedding on what the Rubocop configuration should be.
10+
- Code that is consistently formatted and styled will be easier to work with.
11+
12+
There are, however, a few reasons one might choose not to introduce Standard in a project:
13+
14+
- Change for the sake of change can be disruptive
15+
- An existing project may already employ it's own opinionated configuration of Rubocop and that set of rules is working.
16+
- A large project, which does not already use Standard, might require a costly amount of time to refactor and retrofit
17+
existing code to conform to a new set of conventions.
18+
- There exists a need or desire to use Cops which are disabled by Standard
19+
20+
Overall, the goal is to increase the quality and consistency of code while not getting distracted by disproportionally
21+
minor or trivial details. It's more important for an implementation team to agree to follow shared conventions than it
22+
is to enforce a specific configuration.
23+
24+
[standard]: https://github.com/testdouble/standard

0 commit comments

Comments
 (0)