diff --git a/app/models/names_manager/false_positives.rb b/app/models/names_manager/false_positives.rb index 8458027e..d9fc032f 100644 --- a/app/models/names_manager/false_positives.rb +++ b/app/models/names_manager/false_positives.rb @@ -66,6 +66,10 @@ def handle_false_positives(name) $1 when /\A(?:DHH\s*)?via\s+(.*)/i $1 + # These are present in some of Ben Sheldon commits. This pattern needs + # ad-hoc handling because "/" is considered to be a name connector. + when %r{\[he/him\]} + $`.strip when /\b\w+\+\w+@/ # The plus sign is taken to be a connector below, this catches some known # addresses that use a plus sign in the username, see unit tests for examples. diff --git a/test/credits/false_positives_test.rb b/test/credits/false_positives_test.rb index 1ec421c4..931d2ac8 100644 --- a/test/credits/false_positives_test.rb +++ b/test/credits/false_positives_test.rb @@ -269,5 +269,9 @@ class FalsePositivesTest < ActiveSupport::TestCase test 'ignores unknown contributors referred as "others"' do assert_contributor_names 'da4b15f', 'Kevin Jackson', 'David Heinemeier Hansson', exact: true end + + test '[he/him] ad-hoc handling' do + assert_contributor_names 'fe03a19', 'Ben Sheldon' + end end end