Class: Dependabot::PullRequestCreator::PrNamePrefixer
- Inherits:
-
Object
- Object
- Dependabot::PullRequestCreator::PrNamePrefixer
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/pull_request_creator/pr_name_prefixer.rb
Overview
rubocop:disable Metrics/ClassLength
Defined Under Namespace
Classes: RecentCommit
Constant Summary collapse
- ANGULAR_PREFIXES =
%w(build chore ci docs feat fix perf refactor style test).freeze
- ESLINT_PREFIXES =
%w(Breaking Build Chore Docs Fix New Update Upgrade).freeze
- GITMOJI_PREFIXES =
%w( alien ambulance apple arrow_down arrow_up art beers bento bookmark boom bug building_construction bulb busts_in_silhouette camera_flash card_file_box chart_with_upwards_trend checkered_flag children_crossing clown_face construction construction_worker egg fire globe_with_meridians green_apple green_heart hankey heavy_minus_sign heavy_plus_sign iphone lipstick lock loud_sound memo mute ok_hand package page_facing_up pencil2 penguin pushpin recycle rewind robot rocket rotating_light see_no_evil sparkles speech_balloon tada truck twisted_rightwards_arrows whale wheelchair white_check_mark wrench zap ).freeze
Instance Method Summary collapse
- #capitalize_first_word? ⇒ Boolean
-
#initialize(source:, dependencies:, credentials:, security_fix: false, commit_message_options: {}) ⇒ PrNamePrefixer
constructor
A new instance of PrNamePrefixer.
- #pr_name_prefix ⇒ Object
Constructor Details
#initialize(source:, dependencies:, credentials:, security_fix: false, commit_message_options: {}) ⇒ PrNamePrefixer
Returns a new instance of PrNamePrefixer.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/dependabot/pull_request_creator/pr_name_prefixer.rb', line 48 def initialize( source:, dependencies:, credentials:, security_fix: false, commit_message_options: {} ) @dependencies = dependencies @source = source @credentials = credentials @security_fix = security_fix @commit_message_options = T.let( && CommitMessageOptions.from_hash(), T.nilable(CommitMessageOptions) ) @recent_github_commits = T.let(nil, T.nilable(T::Array[RecentCommit])) @recent_gitlab_commits = T.let(nil, T.nilable(T::Array[RecentCommit])) @recent_azure_commits = T.let(nil, T.nilable(T::Array[RecentCommit])) @recent_bitbucket_commits = T.let(nil, T.nilable(T::Array[RecentCommit])) @recent_codecommit_commits = T.let(nil, T.nilable(T::Array[RecentCommit])) end |
Instance Method Details
#capitalize_first_word? ⇒ Boolean
78 79 80 81 82 83 84 85 |
# File 'lib/dependabot/pull_request_creator/pr_name_prefixer.rb', line 78 def capitalize_first_word? return capitalise_first_word_from_last_dependabot_commit_style if last_dependabot_commit_style capitalise_first_word_from_previous_commits rescue StandardError # ignoring failure due to network call to find out if the PR should be capitalized false end |
#pr_name_prefix ⇒ Object
71 72 73 74 75 |
# File 'lib/dependabot/pull_request_creator/pr_name_prefixer.rb', line 71 def pr_name_prefix prefix = commit_prefix.to_s prefix += security_prefix if security_fix? prefix.gsub("⬆️ 🔒", "⬆️🔒") end |