Skip to content

Commit 7e21a35

Browse files
committed
Fix credit in some of Ben Sheldon commits
The logic for false positives considers "/" to be a name connector, but some commits from Ben Sheldon have "[he/him]" in the commit message. Current heuristics guess that those commits have two authors: ["Ben Sheldon [he", "him]"] This pattern needs a new rule.
1 parent 345e9d1 commit 7e21a35

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

app/models/names_manager/false_positives.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ def handle_false_positives(name)
6666
$1
6767
when /\A(?:DHH\s*)?via\s+(.*)/i
6868
$1
69+
# These are present in some of Ben Sheldon commits. This pattern needs
70+
# ad-hoc handling because "/" is considered to be a name connector.
71+
when %r{\[he/him\]}
72+
$`.strip
6973
when /\b\w+\+\w+@/
7074
# The plus sign is taken to be a connector below, this catches some known
7175
# addresses that use a plus sign in the username, see unit tests for examples.

test/credits/false_positives_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,5 +269,9 @@ class FalsePositivesTest < ActiveSupport::TestCase
269269
test 'ignores unknown contributors referred as "others"' do
270270
assert_contributor_names 'da4b15f', 'Kevin Jackson', 'David Heinemeier Hansson', exact: true
271271
end
272+
273+
test '[he/him] ad-hoc handling' do
274+
assert_contributor_names 'fe03a19', 'Ben Sheldon'
275+
end
272276
end
273277
end

0 commit comments

Comments
 (0)