Skip to content

Commit

Permalink
Fix credit in some of Ben Sheldon commits
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fxn committed Sep 8, 2024
1 parent 345e9d1 commit 7e21a35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/names_manager/false_positives.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions test/credits/false_positives_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7e21a35

Please sign in to comment.