Skip to content

Commit c5de6aa

Browse files
committed
Tweak Naming/InclusiveLanguage AllowedRegex
- Generalize to permitting all URLs, as they are generally out of the author's control (looks for `%r{\w*://\S+}`). - Continue explicitly permitting `blob/master`, and add `tree/master`, in case of schemeless URL (`github.com/org/repo/blob/master/README`) - Allow space between `origin` and `master`, in addition to `/`, to allow usage like `git pull origin master`.
1 parent 76575a2 commit c5de6aa

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

rubocop.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,9 @@ Naming/InclusiveLanguage:
372372
- leader
373373
AllowedRegex:
374374
- !ruby/regexp '/master[_\s\.]key/' # Rails master key
375-
- 'blob/master/'
376-
- 'origin/master'
375+
- !ruby/regexp /\w*:\/\/\S+/ # URLs (e.g. https://github.com/org/repo/blob/master/README.md)
376+
- !ruby/regexp '/(?:blob|tree)/master/' # e.g. github.com/org/repo/blob/master/README.md, without https://
377+
- !ruby/regexp '/origin[ \/]master/' # Legacy default git branch name
377378
- 'mastercard'
378379
- 'webmaster'
379380

test/fixtures/full_config.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,8 +2113,9 @@ Naming/InclusiveLanguage:
21132113
- leader
21142114
AllowedRegex:
21152115
- !ruby/regexp /master[_\s\.]key/
2116-
- blob/master/
2117-
- origin/master
2116+
- !ruby/regexp /\w*:\/\/\S+/
2117+
- !ruby/regexp /(?:blob|tree)\/master/
2118+
- !ruby/regexp /origin[ \/]master/
21182119
- mastercard
21192120
- webmaster
21202121
Naming/MemoizedInstanceVariableName:

0 commit comments

Comments
 (0)