Class: Danger::PodfileChecker
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::PodfileChecker
- Defined in:
- lib/dangermattic/plugins/podfile_checker.rb
Overview
Plugin for checking that the Podfile.lock doesn't contain direct commit references.
Constant Summary collapse
- PODFILE_LOCK =
'Podfile.lock'- PODFILE_LOCK_DEPENDENCIES_ENTRY =
'DEPENDENCIES'- DEFAULT_PODFILE_LOCK_PATH =
'./Podfile.lock'
Instance Method Summary collapse
-
#check_podfile_diff_does_not_have_branch_references(report_type: :warning) ⇒ void
Check for Podfile references to branches in the Podfile.lock in a pull request.
-
#check_podfile_diff_does_not_have_commit_references(report_type: :warning) ⇒ void
Check for Podfile references to commit hashes in the Podfile.lock in a pull request.
-
#check_podfile_does_not_have_branch_references(podfile_lock_path: DEFAULT_PODFILE_LOCK_PATH, report_type: :error) ⇒ void
Check if the Podfile.lock contains any references to branches and raise a failure if it does.
-
#check_podfile_does_not_have_commit_references(podfile_lock_path: DEFAULT_PODFILE_LOCK_PATH, report_type: :error) ⇒ void
Check if the Podfile.lock contains any references to commit hashes and raise a failure if it does.
Instance Method Details
#check_podfile_diff_does_not_have_branch_references(report_type: :warning) ⇒ void
This method returns an undefined value.
Check for Podfile references to branches in the Podfile.lock in a pull request.
81 82 83 84 |
# File 'lib/dangermattic/plugins/podfile_checker.rb', line 81 def check_podfile_diff_does_not_have_branch_references(report_type: :warning) = 'This PR adds a Podfile reference to a branch:' check_podfile_diff_entries_do_not_match(regexp: BRANCH_REFERENCE_REGEXP, match_found_message: , report_type: report_type) end |
#check_podfile_diff_does_not_have_commit_references(report_type: :warning) ⇒ void
This method returns an undefined value.
Check for Podfile references to commit hashes in the Podfile.lock in a pull request.
49 50 51 52 |
# File 'lib/dangermattic/plugins/podfile_checker.rb', line 49 def check_podfile_diff_does_not_have_commit_references(report_type: :warning) = 'This PR adds a Podfile reference to a commit hash:' check_podfile_diff_entries_do_not_match(regexp: COMMIT_REFERENCE_REGEXP, match_found_message: , report_type: report_type) end |
#check_podfile_does_not_have_branch_references(podfile_lock_path: DEFAULT_PODFILE_LOCK_PATH, report_type: :error) ⇒ void
This method returns an undefined value.
Check if the Podfile.lock contains any references to branches and raise a failure if it does.
67 68 69 70 71 72 73 74 |
# File 'lib/dangermattic/plugins/podfile_checker.rb', line 67 def check_podfile_does_not_have_branch_references(podfile_lock_path: DEFAULT_PODFILE_LOCK_PATH, report_type: :error) check_podfile_does_not_match( regexp: BRANCH_REFERENCE_REGEXP, podfile_lock_path: podfile_lock_path, match_found_message_generator: ->(matches) { "Podfile reference(s) to a branch:\n```#{matches.join("\n")}```" }, report_type: report_type ) end |
#check_podfile_does_not_have_commit_references(podfile_lock_path: DEFAULT_PODFILE_LOCK_PATH, report_type: :error) ⇒ void
This method returns an undefined value.
Check if the Podfile.lock contains any references to commit hashes and raise a failure if it does.
35 36 37 38 39 40 41 42 |
# File 'lib/dangermattic/plugins/podfile_checker.rb', line 35 def check_podfile_does_not_have_commit_references(podfile_lock_path: DEFAULT_PODFILE_LOCK_PATH, report_type: :error) check_podfile_does_not_match( regexp: COMMIT_REFERENCE_REGEXP, podfile_lock_path: podfile_lock_path, match_found_message_generator: ->(matches) { "Podfile reference(s) to a commit hash:\n```#{matches.join("\n")}```" }, report_type: report_type ) end |