Class: Overcommit::HookContext::RunAll
- Defined in:
- lib/overcommit/hook_context/run_all.rb
Overview
Simulates a pre-commit context pretending that all files have been changed.
This results in pre-commit hooks running against the entire repository, which is useful for automated CI scripts.
Constant Summary collapse
- EMPTY_SET =
Set.new
Instance Method Summary collapse
- #hook_class_name ⇒ Object
- #hook_script_name ⇒ Object
- #hook_type_name ⇒ Object
- #modified_files ⇒ Object
-
#modified_lines_in_file(_file) ⇒ Object
Return an empty set since in this context the user didn’t actually touch any lines.
Methods inherited from Base
#cleanup_environment, #initialize, #modified_lines, #setup_environment
Constructor Details
This class inherits a constructor from Overcommit::HookContext::Base
Instance Method Details
#hook_class_name ⇒ Object
21 22 23 |
# File 'lib/overcommit/hook_context/run_all.rb', line 21 def hook_class_name 'PreCommit' end |
#hook_script_name ⇒ Object
29 30 31 |
# File 'lib/overcommit/hook_context/run_all.rb', line 29 def hook_script_name 'pre-commit' end |
#hook_type_name ⇒ Object
25 26 27 |
# File 'lib/overcommit/hook_context/run_all.rb', line 25 def hook_type_name 'pre_commit' end |
#modified_files ⇒ Object
11 12 13 |
# File 'lib/overcommit/hook_context/run_all.rb', line 11 def modified_files all_files end |
#modified_lines_in_file(_file) ⇒ Object
Return an empty set since in this context the user didn’t actually touch any lines.
17 18 19 |
# File 'lib/overcommit/hook_context/run_all.rb', line 17 def modified_lines_in_file(_file) EMPTY_SET end |