shotgrid_api_ruby 0.2.0.4 → 0.2.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test_and_publish.yml +3 -3
  3. data/.github/workflows/test_only.yml +7 -5
  4. data/.ruby-version +1 -1
  5. data/CHANGELOG.md +54 -2
  6. data/Gemfile +12 -0
  7. data/Gemfile.lock +108 -93
  8. data/bin/prettirun +1 -1
  9. data/docs/ShotgridApiRuby/Auth/Validator.html +4 -4
  10. data/docs/ShotgridApiRuby/Auth.html +4 -4
  11. data/docs/ShotgridApiRuby/Client.html +4 -4
  12. data/docs/ShotgridApiRuby/Entities/Params/TooComplexFiltersError.html +4 -4
  13. data/docs/ShotgridApiRuby/Entities/Params.html +41 -41
  14. data/docs/ShotgridApiRuby/Entities/Schema.html +4 -4
  15. data/docs/ShotgridApiRuby/Entities/Summarize/Summary.html +8 -8
  16. data/docs/ShotgridApiRuby/Entities/Summarize.html +9 -9
  17. data/docs/ShotgridApiRuby/Entities.html +27 -27
  18. data/docs/ShotgridApiRuby/Entity.html +12 -12
  19. data/docs/ShotgridApiRuby/Preferences.html +4 -4
  20. data/docs/ShotgridApiRuby/ServerInfo.html +4 -4
  21. data/docs/ShotgridApiRuby/ShotgridCallError.html +4 -4
  22. data/docs/ShotgridApiRuby/Types.html +4 -4
  23. data/docs/ShotgridApiRuby.html +5 -5
  24. data/docs/_index.html +5 -5
  25. data/docs/file.README.html +4 -4
  26. data/docs/frames.html +1 -1
  27. data/docs/index.html +4 -4
  28. data/docs/top-level-namespace.html +4 -4
  29. data/lib/shotgrid_api_ruby/entities/params.rb +15 -18
  30. data/lib/shotgrid_api_ruby/entities/summarize.rb +4 -4
  31. data/lib/shotgrid_api_ruby/entities.rb +23 -23
  32. data/lib/shotgrid_api_ruby/version.rb +1 -1
  33. data/shotgrid_api_ruby.gemspec +3 -12
  34. data/sorbet/rbi/gems/activesupport@7.0.4.2.rbi +18676 -0
  35. data/sorbet/rbi/gems/ast@2.4.2.rbi +533 -3
  36. data/sorbet/rbi/gems/backport@1.2.0.rbi +518 -4
  37. data/sorbet/rbi/gems/benchmark@0.2.1.rbi +588 -0
  38. data/sorbet/rbi/gems/bundler-audit@0.9.1.rbi +308 -0
  39. data/sorbet/rbi/gems/byebug@11.1.3.rbi +2065 -28
  40. data/sorbet/rbi/gems/childprocess@4.1.0.rbi +397 -4
  41. data/sorbet/rbi/gems/coderay@1.1.3.rbi +2425 -4
  42. data/sorbet/rbi/gems/concurrent-ruby@1.2.0.rbi +11570 -0
  43. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1083 -0
  44. data/sorbet/rbi/gems/docile@1.4.0.rbi +335 -13
  45. data/sorbet/rbi/gems/dotenv@2.8.1.rbi +234 -0
  46. data/sorbet/rbi/gems/e2mmap@0.1.0.rbi +4 -4
  47. data/sorbet/rbi/gems/faker@3.1.0.rbi +13380 -0
  48. data/sorbet/rbi/gems/faraday-em_http@1.0.0.rbi +167 -11
  49. data/sorbet/rbi/gems/faraday-em_synchrony@1.0.0.rbi +94 -11
  50. data/sorbet/rbi/gems/faraday-excon@1.1.0.rbi +105 -11
  51. data/sorbet/rbi/gems/faraday-httpclient@1.0.1.rbi +118 -11
  52. data/sorbet/rbi/gems/faraday-multipart@1.0.4.rbi +273 -0
  53. data/sorbet/rbi/gems/faraday-net_http@1.0.1.rbi +106 -11
  54. data/sorbet/rbi/gems/faraday-net_http_persistent@1.2.0.rbi +92 -11
  55. data/sorbet/rbi/gems/faraday-patron@1.0.0.rbi +97 -11
  56. data/sorbet/rbi/gems/faraday-rack@1.0.0.rbi +106 -11
  57. data/sorbet/rbi/gems/faraday-retry@1.0.3.rbi +227 -0
  58. data/sorbet/rbi/gems/faraday@1.10.3.rbi +2743 -0
  59. data/sorbet/rbi/gems/ffi@1.15.5.rbi +8 -0
  60. data/sorbet/rbi/gems/formatador@1.1.0.rbi +8 -0
  61. data/sorbet/rbi/gems/guard-compat@1.2.1.rbi +62 -4
  62. data/sorbet/rbi/gems/guard-rspec@4.7.3.rbi +558 -4
  63. data/sorbet/rbi/gems/guard@2.18.0.rbi +4 -4
  64. data/sorbet/rbi/gems/haml@6.1.1.rbi +1588 -0
  65. data/sorbet/rbi/gems/i18n@1.12.0.rbi +2296 -0
  66. data/sorbet/rbi/gems/iniparse@1.5.0.rbi +893 -4
  67. data/sorbet/rbi/gems/jaro_winkler@1.5.4.rbi +15 -4
  68. data/sorbet/rbi/gems/json@2.6.3.rbi +1533 -0
  69. data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +129 -4
  70. data/sorbet/rbi/gems/kramdown@2.4.0.rbi +3271 -0
  71. data/sorbet/rbi/gems/listen@3.8.0.rbi +1181 -0
  72. data/sorbet/rbi/gems/lumberjack@1.2.8.rbi +4 -4
  73. data/sorbet/rbi/gems/method_source@1.0.0.rbi +202 -2
  74. data/sorbet/rbi/gems/minitest@5.17.0.rbi +1457 -0
  75. data/sorbet/rbi/gems/multipart-post@2.3.0.rbi +233 -0
  76. data/sorbet/rbi/gems/nenv@0.3.0.rbi +4 -4
  77. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  78. data/sorbet/rbi/gems/nokogiri@1.14.0.rbi +7250 -0
  79. data/sorbet/rbi/gems/notiffany@0.1.3.rbi +4 -4
  80. data/sorbet/rbi/gems/overcommit@0.60.0.rbi +2399 -0
  81. data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
  82. data/sorbet/rbi/gems/parser@3.2.0.0.rbi +6964 -0
  83. data/sorbet/rbi/gems/prettier@3.2.2.rbi +22 -0
  84. data/sorbet/rbi/gems/prettier_print@1.2.0.rbi +8 -0
  85. data/sorbet/rbi/gems/pry-byebug@3.10.1.rbi +1171 -0
  86. data/sorbet/rbi/gems/pry@0.14.2.rbi +10081 -0
  87. data/sorbet/rbi/gems/racc@1.6.2.rbi +154 -0
  88. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +408 -0
  89. data/sorbet/rbi/gems/rake@13.0.6.rbi +2248 -13
  90. data/sorbet/rbi/gems/rb-fsevent@0.11.2.rbi +8 -0
  91. data/sorbet/rbi/gems/rb-inotify@0.10.1.rbi +4 -4
  92. data/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
  93. data/sorbet/rbi/gems/rbs@2.8.4.rbi +8 -0
  94. data/sorbet/rbi/gems/regexp_parser@2.6.2.rbi +3481 -0
  95. data/sorbet/rbi/gems/reverse_markdown@2.1.1.rbi +389 -0
  96. data/sorbet/rbi/gems/rexml@3.2.5.rbi +4048 -3
  97. data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10809 -0
  98. data/sorbet/rbi/gems/rspec-expectations@3.12.2.rbi +8109 -0
  99. data/sorbet/rbi/gems/rspec-mocks@3.12.3.rbi +5308 -0
  100. data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1620 -0
  101. data/sorbet/rbi/gems/rspec@3.12.0.rbi +91 -0
  102. data/sorbet/rbi/gems/rspec_in_context@1.1.0.3.rbi +387 -15
  103. data/sorbet/rbi/gems/rubocop-ast@1.24.1.rbi +7019 -0
  104. data/sorbet/rbi/gems/rubocop-faker@1.1.0.rbi +102 -4
  105. data/sorbet/rbi/gems/rubocop-performance@1.15.2.rbi +3021 -0
  106. data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +990 -0
  107. data/sorbet/rbi/gems/rubocop@1.44.1.rbi +54394 -0
  108. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +1235 -4
  109. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +4 -4
  110. data/sorbet/rbi/gems/shellany@0.0.1.rbi +4 -4
  111. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +135 -5
  112. data/sorbet/rbi/gems/simplecov@0.22.0.rbi +2148 -0
  113. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +8 -0
  114. data/sorbet/rbi/gems/solargraph@0.48.0.rbi +9146 -0
  115. data/sorbet/rbi/gems/spoom@1.1.15.rbi +2383 -0
  116. data/sorbet/rbi/gems/syntax_tree-haml@3.0.0.rbi +8 -0
  117. data/sorbet/rbi/gems/syntax_tree-rbs@0.5.1.rbi +8 -0
  118. data/sorbet/rbi/gems/syntax_tree@5.2.0.rbi +8 -0
  119. data/sorbet/rbi/gems/tapioca@0.10.5.rbi +3226 -0
  120. data/sorbet/rbi/gems/temple@0.10.0.rbi +1722 -0
  121. data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
  122. data/sorbet/rbi/gems/tilt@2.0.11.rbi +745 -0
  123. data/sorbet/rbi/gems/timecop@0.9.6.rbi +368 -0
  124. data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +5914 -0
  125. data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +65 -0
  126. data/sorbet/rbi/gems/unparser@0.6.7.rbi +4524 -0
  127. data/sorbet/rbi/gems/vcr@6.1.0.rbi +3020 -0
  128. data/sorbet/rbi/gems/webrick@1.7.0.rbi +2555 -0
  129. data/sorbet/rbi/gems/yard-sorbet@0.8.0.rbi +441 -0
  130. data/sorbet/rbi/gems/yard@0.9.28.rbi +17863 -0
  131. data/sorbet/rbi/gems/zeitwerk@2.6.6.rbi +950 -0
  132. data/yarn.lock +3 -3
  133. metadata +71 -190
  134. data/sorbet/rbi/gems/activesupport@6.1.4.1.rbi +0 -3770
  135. data/sorbet/rbi/gems/benchmark@0.1.1.rbi +0 -65
  136. data/sorbet/rbi/gems/bundler-audit@0.8.0.rbi +0 -8
  137. data/sorbet/rbi/gems/colorize@0.8.1.rbi +0 -39
  138. data/sorbet/rbi/gems/commander@4.6.0.rbi +0 -8
  139. data/sorbet/rbi/gems/concurrent-ruby@1.1.9.rbi +0 -2403
  140. data/sorbet/rbi/gems/diff-lcs@1.4.4.rbi +0 -8
  141. data/sorbet/rbi/gems/dotenv@2.7.6.rbi +0 -88
  142. data/sorbet/rbi/gems/faker@2.19.0.rbi +0 -2513
  143. data/sorbet/rbi/gems/faraday@1.7.0.rbi +0 -783
  144. data/sorbet/rbi/gems/ffi@1.15.3.rbi +0 -8
  145. data/sorbet/rbi/gems/formatador@0.3.0.rbi +0 -8
  146. data/sorbet/rbi/gems/haml@5.2.2.rbi +0 -8
  147. data/sorbet/rbi/gems/highline@2.0.3.rbi +0 -8
  148. data/sorbet/rbi/gems/i18n@1.8.10.rbi +0 -584
  149. data/sorbet/rbi/gems/kramdown@2.3.1.rbi +0 -8
  150. data/sorbet/rbi/gems/listen@3.7.0.rbi +0 -476
  151. data/sorbet/rbi/gems/minitest@5.14.4.rbi +0 -344
  152. data/sorbet/rbi/gems/multipart-post@2.1.1.rbi +0 -69
  153. data/sorbet/rbi/gems/nokogiri@1.12.3.rbi +0 -8
  154. data/sorbet/rbi/gems/overcommit@0.58.0.rbi +0 -8
  155. data/sorbet/rbi/gems/parallel@1.20.1.rbi +0 -8
  156. data/sorbet/rbi/gems/parlour@6.0.1.rbi +0 -1610
  157. data/sorbet/rbi/gems/parser@3.0.2.0.rbi +0 -1731
  158. data/sorbet/rbi/gems/prettier@1.6.1.rbi +0 -8
  159. data/sorbet/rbi/gems/pry-byebug@3.9.0.rbi +0 -461
  160. data/sorbet/rbi/gems/pry@0.13.1.rbi +0 -2553
  161. data/sorbet/rbi/gems/racc@1.5.2.rbi +0 -47
  162. data/sorbet/rbi/gems/rainbow@3.0.0.rbi +0 -153
  163. data/sorbet/rbi/gems/rb-fsevent@0.11.0.rbi +0 -8
  164. data/sorbet/rbi/gems/regexp_parser@2.1.1.rbi +0 -8
  165. data/sorbet/rbi/gems/reverse_markdown@2.0.0.rbi +0 -8
  166. data/sorbet/rbi/gems/rspec-core@3.10.1.rbi +0 -2500
  167. data/sorbet/rbi/gems/rspec-expectations@3.10.1.rbi +0 -1574
  168. data/sorbet/rbi/gems/rspec-mocks@3.10.2.rbi +0 -1462
  169. data/sorbet/rbi/gems/rspec-support@3.10.2.rbi +0 -510
  170. data/sorbet/rbi/gems/rspec@3.10.0.rbi +0 -39
  171. data/sorbet/rbi/gems/rubocop-ast@1.11.0.rbi +0 -8
  172. data/sorbet/rbi/gems/rubocop-performance@1.11.5.rbi +0 -8
  173. data/sorbet/rbi/gems/rubocop-sorbet@0.6.2.rbi +0 -8
  174. data/sorbet/rbi/gems/rubocop@1.20.0.rbi +0 -8
  175. data/sorbet/rbi/gems/simplecov@0.21.2.rbi +0 -577
  176. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.3.rbi +0 -8
  177. data/sorbet/rbi/gems/solargraph@0.43.0.rbi +0 -8
  178. data/sorbet/rbi/gems/spoom@1.1.2.rbi +0 -1204
  179. data/sorbet/rbi/gems/tapioca@0.4.25.rbi +0 -1239
  180. data/sorbet/rbi/gems/temple@0.8.2.rbi +0 -8
  181. data/sorbet/rbi/gems/thor@1.1.0.rbi +0 -838
  182. data/sorbet/rbi/gems/tilt@2.0.10.rbi +0 -8
  183. data/sorbet/rbi/gems/timecop@0.9.4.rbi +0 -82
  184. data/sorbet/rbi/gems/tzinfo@2.0.4.rbi +0 -857
  185. data/sorbet/rbi/gems/unicode-display_width@2.0.0.rbi +0 -8
  186. data/sorbet/rbi/gems/unparser@0.6.0.rbi +0 -8
  187. data/sorbet/rbi/gems/vcr@6.0.0.rbi +0 -782
  188. data/sorbet/rbi/gems/yard-sorbet@0.5.3.rbi +0 -8
  189. data/sorbet/rbi/gems/yard@0.9.26.rbi +0 -8
  190. data/sorbet/rbi/gems/zeitwerk@2.4.2.rbi +0 -173
@@ -0,0 +1,2399 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `overcommit` gem.
5
+ # Please instead update this file by running `bin/tapioca gem overcommit`.
6
+
7
+ # Provides a handler for interrupt signals (SIGINT), allowing the application to
8
+ # finish what it's currently working on.
9
+ #
10
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#7
11
+ class InterruptHandler
12
+ include ::Singleton
13
+ extend ::Singleton::SingletonClassMethods
14
+
15
+ # Initialize safe interrupt signal handling.
16
+ #
17
+ # @return [InterruptHandler] a new instance of InterruptHandler
18
+ #
19
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#13
20
+ def initialize; end
21
+
22
+ # Returns the value of attribute isolate_signals.
23
+ #
24
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#10
25
+ def isolate_signals; end
26
+
27
+ # Sets the attribute isolate_signals
28
+ #
29
+ # @param value the value to set the attribute isolate_signals to.
30
+ #
31
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#10
32
+ def isolate_signals=(_arg0); end
33
+
34
+ # Returns the value of attribute reenable_on_interrupt.
35
+ #
36
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#10
37
+ def reenable_on_interrupt; end
38
+
39
+ # Sets the attribute reenable_on_interrupt
40
+ #
41
+ # @param value the value to set the attribute reenable_on_interrupt to.
42
+ #
43
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#10
44
+ def reenable_on_interrupt=(_arg0); end
45
+
46
+ # Returns the value of attribute signal_received.
47
+ #
48
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#10
49
+ def signal_received; end
50
+
51
+ # Sets the attribute signal_received
52
+ #
53
+ # @param value the value to set the attribute signal_received to.
54
+ #
55
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#10
56
+ def signal_received=(_arg0); end
57
+
58
+ class << self
59
+ # Disable interrupt isolation.
60
+ #
61
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#71
62
+ def disable!; end
63
+
64
+ # Provide a way to allow a single Ctrl-C interrupt to happen and atomically
65
+ # re-enable interrupt protections once that interrupt is propagated.
66
+ #
67
+ # This prevents a race condition where code like the following:
68
+ #
69
+ # begin
70
+ # InterruptHandler.disable!
71
+ # ... do stuff ...
72
+ # rescue Interrupt
73
+ # ... handle it ...
74
+ # ensure
75
+ # InterruptHandler.enable!
76
+ # end
77
+ #
78
+ # ...could have the `enable!` call to the interrupt handler not called in
79
+ # the event another interrupt was received in between the interrupt being
80
+ # handled and the `ensure` block being entered.
81
+ #
82
+ # Thus you should always write:
83
+ #
84
+ # begin
85
+ # InterruptHandler.disable_until_finished_or_interrupted do
86
+ # ... do stuff ...
87
+ # end
88
+ # rescue Interrupt
89
+ # ... handle it ...
90
+ # rescue
91
+ # ... handle any other exceptions ...
92
+ # end
93
+ #
94
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#62
95
+ def disable_until_finished_or_interrupted; end
96
+
97
+ # Enable interrupt isolation.
98
+ #
99
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#76
100
+ def enable!; end
101
+
102
+ # Enable interrupt isolation while executing the provided block.
103
+ #
104
+ # @yield block to execute with interrupt isolation
105
+ #
106
+ # source://overcommit//lib/overcommit/interrupt_handler.rb#83
107
+ def isolate_from_interrupts; end
108
+
109
+ private
110
+
111
+ def allocate; end
112
+ def new(*_arg0); end
113
+ end
114
+ end
115
+
116
+ # Defines the gem version.
117
+ #
118
+ # source://overcommit//lib/overcommit/os.rb#5
119
+ module Overcommit; end
120
+
121
+ # source://overcommit//lib/overcommit/constants.rb#12
122
+ Overcommit::BUG_REPORT_URL = T.let(T.unsafe(nil), String)
123
+
124
+ # source://overcommit//lib/overcommit/constants.rb#6
125
+ Overcommit::CONFIG_FILE_NAME = T.let(T.unsafe(nil), String)
126
+
127
+ # Distributes a list of arguments over multiple invocations of a command.
128
+ #
129
+ # This accomplishes the same functionality provided by `xargs` but in a
130
+ # cross-platform way that does not require any pre-existing tools.
131
+ #
132
+ # One of the tradeoffs with this approach is that we no longer deal with a
133
+ # single exit status from a command, but multiple (one for each invocation).
134
+ #
135
+ # This will return a struct similar to `Subprocess::Result` but with
136
+ # additional `statuses`, `stdouts`, and `stderrs` fields so hook authors can
137
+ # actually see the results of each invocation. If they don't care, the
138
+ # standard `status`, `stdout`, and `stderr` will still work but be a
139
+ # aggregation/concatenation of all statuses/outputs.
140
+ #
141
+ # source://overcommit//lib/overcommit/command_splitter.rb#17
142
+ class Overcommit::CommandSplitter
143
+ class << self
144
+ # source://overcommit//lib/overcommit/command_splitter.rb#56
145
+ def execute(initial_args, options); end
146
+
147
+ private
148
+
149
+ # @return [Array<Array<String>, Integer>] tuple of arguments and new index
150
+ #
151
+ # source://overcommit//lib/overcommit/command_splitter.rb#104
152
+ def arguments_under_limit(splittable_args, start_index, byte_limit); end
153
+
154
+ # Given a list of prefix arguments and suffix arguments that can be split,
155
+ # returns a list of argument lists that are executable on the current OS
156
+ # without exceeding command line limitations.
157
+ #
158
+ # source://overcommit//lib/overcommit/command_splitter.rb#79
159
+ def extract_argument_lists(args, splittable_args); end
160
+
161
+ # Returns the maximum number of arguments allowed in a single command on
162
+ # this system.
163
+ #
164
+ # @return [Integer]
165
+ #
166
+ # source://overcommit//lib/overcommit/command_splitter.rb#132
167
+ def max_command_length; end
168
+ end
169
+ end
170
+
171
+ # Encapsulates the result of a split argument run.
172
+ #
173
+ # @attr_reader statuses [Array<Integer>] status codes for invocations
174
+ # @attr_reader stdouts [Array<String>] standard outputs from invocations
175
+ # @attr_reader stderrs [Array<String>] standard error outputs from invocations
176
+ #
177
+ # source://overcommit//lib/overcommit/command_splitter.rb#23
178
+ class Overcommit::CommandSplitter::Result < ::Struct
179
+ # Returns `0` if all invocations returned `0`; `1` otherwise.
180
+ #
181
+ # @return [true, false]
182
+ #
183
+ # source://overcommit//lib/overcommit/command_splitter.rb#34
184
+ def status; end
185
+
186
+ # status codes for invocations
187
+ #
188
+ # @return [Array<Integer>] the current value of statuses
189
+ def statuses; end
190
+
191
+ def statuses=(_); end
192
+
193
+ # Returns concatenated standard error streams of all invocations in the
194
+ # order they were executed.
195
+ #
196
+ # @return [String]
197
+ #
198
+ # source://overcommit//lib/overcommit/command_splitter.rb#50
199
+ def stderr; end
200
+
201
+ # standard error outputs from invocations
202
+ #
203
+ # @return [Array<String>] the current value of stderrs
204
+ def stderrs; end
205
+
206
+ def stderrs=(_); end
207
+
208
+ # Returns concatenated standard output streams of all invocations in the
209
+ # order they were executed.
210
+ #
211
+ # @return [String]
212
+ #
213
+ # source://overcommit//lib/overcommit/command_splitter.rb#42
214
+ def stdout; end
215
+
216
+ # standard outputs from invocations
217
+ #
218
+ # @return [Array<String>] the current value of stdouts
219
+ def stdouts; end
220
+
221
+ def stdouts=(_); end
222
+
223
+ # Returns whether all invocations were successful.
224
+ #
225
+ # @return [true, false]
226
+ #
227
+ # source://overcommit//lib/overcommit/command_splitter.rb#27
228
+ def success?; end
229
+
230
+ class << self
231
+ def [](*_arg0); end
232
+ def inspect; end
233
+ def keyword_init?; end
234
+ def members; end
235
+ def new(*_arg0); end
236
+ end
237
+ end
238
+
239
+ # Stores configuration for Overcommit and the hooks it runs.
240
+ #
241
+ # source://overcommit//lib/overcommit/configuration.rb#8
242
+ class Overcommit::Configuration
243
+ # Creates a configuration from the given hash.
244
+ #
245
+ # @option default
246
+ # @option logger
247
+ # @param hash [Hash] loaded YAML config file as a hash
248
+ # @param options [Hash]
249
+ # @param default [Hash] a customizable set of options
250
+ # @param logger [Hash] a customizable set of options
251
+ # @return [Configuration] a new instance of Configuration
252
+ #
253
+ # source://overcommit//lib/overcommit/configuration.rb#15
254
+ def initialize(hash, options = T.unsafe(nil)); end
255
+
256
+ # source://overcommit//lib/overcommit/configuration.rb#24
257
+ def ==(other); end
258
+
259
+ # Access the configuration as if it were a hash.
260
+ #
261
+ # @param key [String]
262
+ # @return [Array, Hash, Number, String]
263
+ #
264
+ # source://overcommit//lib/overcommit/configuration.rb#32
265
+ def [](key); end
266
+
267
+ # Returns configuration for all built-in hooks in each hook type.
268
+ #
269
+ # @return [Hash]
270
+ #
271
+ # source://overcommit//lib/overcommit/configuration.rb#72
272
+ def all_builtin_hook_configs; end
273
+
274
+ # Returns configuration for all hooks in each hook type.
275
+ #
276
+ # @return [Hash]
277
+ #
278
+ # source://overcommit//lib/overcommit/configuration.rb#65
279
+ def all_hook_configs; end
280
+
281
+ # Returns configuration for all plugin hooks in each hook type.
282
+ #
283
+ # @return [Hash]
284
+ #
285
+ # source://overcommit//lib/overcommit/configuration.rb#91
286
+ def all_plugin_hook_configs; end
287
+
288
+ # Applies additional configuration settings based on the provided
289
+ # environment variables.
290
+ #
291
+ # source://overcommit//lib/overcommit/configuration.rb#157
292
+ def apply_environment!(hook_context, env); end
293
+
294
+ # source://overcommit//lib/overcommit/configuration.rb#42
295
+ def concurrency; end
296
+
297
+ # Returns the ad hoc hooks that have been enabled for a hook type.
298
+ #
299
+ # source://overcommit//lib/overcommit/configuration.rb#123
300
+ def enabled_ad_hoc_hooks(hook_context); end
301
+
302
+ # Returns the built-in hooks that have been enabled for a hook type.
303
+ #
304
+ # source://overcommit//lib/overcommit/configuration.rb#115
305
+ def enabled_builtin_hooks(hook_context); end
306
+
307
+ # Returns a non-modifiable configuration for a hook.
308
+ #
309
+ # source://overcommit//lib/overcommit/configuration.rb#131
310
+ def for_hook(hook, hook_type = T.unsafe(nil)); end
311
+
312
+ # Merges the given configuration with this one, returning a new
313
+ # {Configuration}. The provided configuration will either add to or replace
314
+ # any options defined in this configuration.
315
+ #
316
+ # source://overcommit//lib/overcommit/configuration.rb#151
317
+ def merge(config); end
318
+
319
+ # Returns absolute path to the directory that external hook plugins should
320
+ # be loaded from.
321
+ #
322
+ # source://overcommit//lib/overcommit/configuration.rb#38
323
+ def plugin_directory; end
324
+
325
+ # @return [Boolean]
326
+ #
327
+ # source://overcommit//lib/overcommit/configuration.rb#181
328
+ def plugin_hook?(hook_context_or_type, hook_name); end
329
+
330
+ # Return whether a previous signature has been recorded for this
331
+ # configuration.
332
+ #
333
+ # @return [true, false]
334
+ #
335
+ # source://overcommit//lib/overcommit/configuration.rb#205
336
+ def previous_signature?; end
337
+
338
+ # Return whether the signature for this configuration has changed since it
339
+ # was last calculated.
340
+ #
341
+ # @return [true, false]
342
+ #
343
+ # source://overcommit//lib/overcommit/configuration.rb#197
344
+ def signature_changed?; end
345
+
346
+ # Update the currently stored signature for this hook.
347
+ #
348
+ # source://overcommit//lib/overcommit/configuration.rb#234
349
+ def update_signature!; end
350
+
351
+ # Returns whether this configuration should verify itself by checking the
352
+ # stored configuration for the repo.
353
+ #
354
+ # @return [true, false]
355
+ #
356
+ # source://overcommit//lib/overcommit/configuration.rb#213
357
+ def verify_signatures?; end
358
+
359
+ protected
360
+
361
+ # Returns the value of attribute hash.
362
+ #
363
+ # source://overcommit//lib/overcommit/configuration.rb#252
364
+ def hash; end
365
+
366
+ private
367
+
368
+ # @return [Boolean]
369
+ #
370
+ # source://overcommit//lib/overcommit/configuration.rb#256
371
+ def ad_hoc_hook?(hook_context, hook_name); end
372
+
373
+ # @return [Boolean]
374
+ #
375
+ # source://overcommit//lib/overcommit/configuration.rb#266
376
+ def built_in_hook?(hook_context, hook_name); end
377
+
378
+ # @return [Boolean]
379
+ #
380
+ # source://overcommit//lib/overcommit/configuration.rb#279
381
+ def hook_enabled?(hook_context_or_type, hook_name); end
382
+
383
+ # @return [Boolean]
384
+ #
385
+ # source://overcommit//lib/overcommit/configuration.rb#273
386
+ def hook_exists?(hook_context, hook_name); end
387
+
388
+ # Returns the unique signature of this configuration.
389
+ #
390
+ # @return [String]
391
+ #
392
+ # source://overcommit//lib/overcommit/configuration.rb#317
393
+ def signature; end
394
+
395
+ # source://overcommit//lib/overcommit/configuration.rb#342
396
+ def signature_config_key; end
397
+
398
+ # source://overcommit//lib/overcommit/configuration.rb#296
399
+ def smart_merge(parent, child); end
400
+
401
+ # Returns the stored signature of this repo's Overcommit configuration.
402
+ #
403
+ # This is intended to be compared against the current signature of this
404
+ # configuration object.
405
+ #
406
+ # @return [String]
407
+ #
408
+ # source://overcommit//lib/overcommit/configuration.rb#327
409
+ def stored_signature; end
410
+
411
+ # source://overcommit//lib/overcommit/configuration.rb#346
412
+ def verify_signature_config_key; end
413
+ end
414
+
415
+ # Manages configuration file loading.
416
+ #
417
+ # source://overcommit//lib/overcommit/configuration_loader.rb#7
418
+ class Overcommit::ConfigurationLoader
419
+ # Create a configuration loader which writes warnings/errors to the given
420
+ # {Overcommit::Logger} instance.
421
+ #
422
+ # @option verify
423
+ # @param logger [Overcommit::Logger]
424
+ # @param options [Hash]
425
+ # @param verify [Hash] a customizable set of options
426
+ # @return [ConfigurationLoader] a new instance of ConfigurationLoader
427
+ #
428
+ # source://overcommit//lib/overcommit/configuration_loader.rb#47
429
+ def initialize(logger, options = T.unsafe(nil)); end
430
+
431
+ # Loads a configuration, ensuring it extends the default configuration.
432
+ #
433
+ # source://overcommit//lib/overcommit/configuration_loader.rb#71
434
+ def load_file(file, local_file = T.unsafe(nil)); end
435
+
436
+ # Loads and returns the configuration for the repository we're running in.
437
+ #
438
+ # @return [Overcommit::Configuration]
439
+ #
440
+ # source://overcommit//lib/overcommit/configuration_loader.rb#55
441
+ def load_repo_config; end
442
+
443
+ private
444
+
445
+ # source://overcommit//lib/overcommit/configuration_loader.rb#94
446
+ def verify_signatures(config); end
447
+
448
+ class << self
449
+ # Loads and returns the default configuration.
450
+ #
451
+ # @return [Overcommit::Configuration]
452
+ #
453
+ # source://overcommit//lib/overcommit/configuration_loader.rb#14
454
+ def default_configuration; end
455
+
456
+ # Loads configuration from file.
457
+ #
458
+ # @option logger
459
+ # @option verify
460
+ # @option default
461
+ # @param verify [Hash] a customizable set of options
462
+ # @param logger [Hash] a customizable set of options
463
+ # @param options [Hash]
464
+ # @param file [String] path to file
465
+ # @param default [Hash] a customizable set of options
466
+ # @return [Overcommit::Configuration]
467
+ #
468
+ # source://overcommit//lib/overcommit/configuration_loader.rb#26
469
+ def load_from_file(file, options = T.unsafe(nil)); end
470
+ end
471
+ end
472
+
473
+ # source://overcommit//lib/overcommit/configuration_loader.rb#8
474
+ Overcommit::ConfigurationLoader::DEFAULT_CONFIG_PATH = T.let(T.unsafe(nil), String)
475
+
476
+ # Validates and normalizes a configuration.
477
+ #
478
+ # source://overcommit//lib/overcommit/configuration_validator.rb#6
479
+ class Overcommit::ConfigurationValidator
480
+ # Validates hash for any invalid options, normalizing where possible.
481
+ #
482
+ # @option logger
483
+ # @option default
484
+ # @param hash [Hash] hash representation of YAML config
485
+ # @param default [Hash] a customizable set of options
486
+ # @param logger [Hash] a customizable set of options
487
+ # @param options [Hash]
488
+ # @param config [Overcommit::Configuration]
489
+ # @return [Hash] validated hash (potentially modified)
490
+ #
491
+ # source://overcommit//lib/overcommit/configuration_validator.rb#15
492
+ def validate(config, hash, options); end
493
+
494
+ private
495
+
496
+ # Prints a warning if there are any hooks listed in the configuration
497
+ # without `enabled` explicitly set.
498
+ #
499
+ # source://overcommit//lib/overcommit/configuration_validator.rb#125
500
+ def check_for_missing_enabled_option(hash); end
501
+
502
+ # Prints a warning if any hook has a number of processors larger than the
503
+ # global `concurrency` setting.
504
+ #
505
+ # source://overcommit//lib/overcommit/configuration_validator.rb#147
506
+ def check_for_too_many_processors(config, hash); end
507
+
508
+ # Prints a warning if the `verify_plugin_signatures` option is used instead
509
+ # of the new `verify_signatures` option.
510
+ #
511
+ # source://overcommit//lib/overcommit/configuration_validator.rb#174
512
+ def check_for_verify_plugin_signatures_option(hash); end
513
+
514
+ # source://overcommit//lib/overcommit/configuration_validator.rb#58
515
+ def check_hook_env(hash); end
516
+
517
+ # Prints an error message and raises an exception if a hook has an
518
+ # invalid name, since this can result in strange errors elsewhere.
519
+ #
520
+ # source://overcommit//lib/overcommit/configuration_validator.rb#98
521
+ def check_hook_name_format(hash); end
522
+
523
+ # Normalizes `nil` values to empty hashes.
524
+ #
525
+ # This is useful for when we want to merge two configuration hashes
526
+ # together, since it's easier to merge two hashes than to have to check if
527
+ # one of the values is nil.
528
+ #
529
+ # source://overcommit//lib/overcommit/configuration_validator.rb#46
530
+ def convert_nils_to_empty_hashes(hash); end
531
+
532
+ # Ensures that keys for all supported hook types exist (PreCommit,
533
+ # CommitMsg, etc.)
534
+ #
535
+ # source://overcommit//lib/overcommit/configuration_validator.rb#34
536
+ def ensure_hook_type_sections_exist(hash); end
537
+ end
538
+
539
+ # source://overcommit//lib/overcommit/exceptions.rb#3
540
+ module Overcommit::Exceptions; end
541
+
542
+ # Raised when a {Configuration} could not be loaded from a file.
543
+ #
544
+ # source://overcommit//lib/overcommit/exceptions.rb#8
545
+ class Overcommit::Exceptions::ConfigurationError < ::Overcommit::Exceptions::Error; end
546
+
547
+ # Raised when the Overcommit configuration file signature has changed.
548
+ #
549
+ # source://overcommit//lib/overcommit/exceptions.rb#11
550
+ class Overcommit::Exceptions::ConfigurationSignatureChanged < ::Overcommit::Exceptions::Error; end
551
+
552
+ # Base error class.
553
+ #
554
+ # source://overcommit//lib/overcommit/exceptions.rb#5
555
+ class Overcommit::Exceptions::Error < ::StandardError; end
556
+
557
+ # Raised when trying to read/write to/from the local repo git config fails.
558
+ #
559
+ # source://overcommit//lib/overcommit/exceptions.rb#14
560
+ class Overcommit::Exceptions::GitConfigError < ::Overcommit::Exceptions::Error; end
561
+
562
+ # Raised when there was a problem reading git revision information with `rev-list`.
563
+ #
564
+ # source://overcommit//lib/overcommit/exceptions.rb#20
565
+ class Overcommit::Exceptions::GitRevListError < ::Overcommit::Exceptions::Error; end
566
+
567
+ # Raised when there was a problem reading submodule information for a repo.
568
+ #
569
+ # source://overcommit//lib/overcommit/exceptions.rb#17
570
+ class Overcommit::Exceptions::GitSubmoduleError < ::Overcommit::Exceptions::Error; end
571
+
572
+ # Raised when a hook run was cancelled by the user.
573
+ #
574
+ # source://overcommit//lib/overcommit/exceptions.rb#29
575
+ class Overcommit::Exceptions::HookCancelled < ::Overcommit::Exceptions::Error; end
576
+
577
+ # Raised when a {HookContext} is unable to clean the environment after a run.
578
+ #
579
+ # source://overcommit//lib/overcommit/exceptions.rb#26
580
+ class Overcommit::Exceptions::HookCleanupFailed < ::Overcommit::Exceptions::Error; end
581
+
582
+ # Raised when a {HookRunner} could not be loaded.
583
+ #
584
+ # source://overcommit//lib/overcommit/exceptions.rb#35
585
+ class Overcommit::Exceptions::HookContextLoadError < ::Overcommit::Exceptions::Error; end
586
+
587
+ # Raised when a hook could not be loaded by a {HookRunner}.
588
+ #
589
+ # source://overcommit//lib/overcommit/exceptions.rb#32
590
+ class Overcommit::Exceptions::HookLoadError < ::Overcommit::Exceptions::Error; end
591
+
592
+ # Raised when a {HookContext} is unable to setup the environment before a run.
593
+ #
594
+ # source://overcommit//lib/overcommit/exceptions.rb#23
595
+ class Overcommit::Exceptions::HookSetupFailed < ::Overcommit::Exceptions::Error; end
596
+
597
+ # Raised when a pipe character is used in the `execute` helper, as this was
598
+ # likely used in error.
599
+ #
600
+ # source://overcommit//lib/overcommit/exceptions.rb#39
601
+ class Overcommit::Exceptions::InvalidCommandArgs < ::Overcommit::Exceptions::Error; end
602
+
603
+ # Raised when an installation target is not a valid git repository.
604
+ #
605
+ # source://overcommit//lib/overcommit/exceptions.rb#42
606
+ class Overcommit::Exceptions::InvalidGitRepo < ::Overcommit::Exceptions::Error; end
607
+
608
+ # Raised when a hook was defined incorrectly.
609
+ #
610
+ # source://overcommit//lib/overcommit/exceptions.rb#45
611
+ class Overcommit::Exceptions::InvalidHookDefinition < ::Overcommit::Exceptions::Error; end
612
+
613
+ # Raised when one or more hook plugin signatures have changed.
614
+ #
615
+ # source://overcommit//lib/overcommit/exceptions.rb#48
616
+ class Overcommit::Exceptions::InvalidHookSignature < ::Overcommit::Exceptions::Error; end
617
+
618
+ # Raised when there is a problem processing output into {Hook::Messages}s.
619
+ #
620
+ # source://overcommit//lib/overcommit/exceptions.rb#51
621
+ class Overcommit::Exceptions::MessageProcessingError < ::Overcommit::Exceptions::Error; end
622
+
623
+ # Raised when an installation target already contains non-Overcommit hooks.
624
+ #
625
+ # source://overcommit//lib/overcommit/exceptions.rb#54
626
+ class Overcommit::Exceptions::PreExistingHooks < ::Overcommit::Exceptions::Error; end
627
+
628
+ # source://overcommit//lib/overcommit/git_version.rb#13
629
+ Overcommit::GIT_VERSION = T.let(T.unsafe(nil), Overcommit::Utils::Version)
630
+
631
+ # Get configuration options from git
632
+ #
633
+ # source://overcommit//lib/overcommit/git_config.rb#7
634
+ module Overcommit::GitConfig
635
+ private
636
+
637
+ # source://overcommit//lib/overcommit/git_config.rb#10
638
+ def comment_character; end
639
+
640
+ # source://overcommit//lib/overcommit/git_config.rb#16
641
+ def hooks_path; end
642
+
643
+ class << self
644
+ # source://overcommit//lib/overcommit/git_config.rb#10
645
+ def comment_character; end
646
+
647
+ # source://overcommit//lib/overcommit/git_config.rb#16
648
+ def hooks_path; end
649
+ end
650
+ end
651
+
652
+ # Provide a set of utilities for certain interactions with `git`.
653
+ #
654
+ # source://overcommit//lib/overcommit/git_repo.rb#8
655
+ module Overcommit::GitRepo
656
+ private
657
+
658
+ # Returns the names of all files that are tracked by git.
659
+ #
660
+ # @return [Array<String>] list of absolute file paths
661
+ #
662
+ # source://overcommit//lib/overcommit/git_repo.rb#137
663
+ def all_files; end
664
+
665
+ # Returns the names of all branches containing the given commit.
666
+ #
667
+ # @param commit_ref [String] git tree ref that resolves to a commit
668
+ # @return [Array<String>] list of branches containing the given commit
669
+ #
670
+ # source://overcommit//lib/overcommit/git_repo.rb#274
671
+ def branches_containing_commit(commit_ref); end
672
+
673
+ # Returns the name of the currently checked out branch.
674
+ #
675
+ # @return [String]
676
+ #
677
+ # source://overcommit//lib/overcommit/git_repo.rb#283
678
+ def current_branch; end
679
+
680
+ # Extract the set of modified lines from a given file.
681
+ #
682
+ # @param file_path [String]
683
+ # @param options [Hash]
684
+ # @return [Set] line numbers that have been modified in file
685
+ #
686
+ # source://overcommit//lib/overcommit/git_repo.rb#68
687
+ def extract_modified_lines(file_path, options); end
688
+
689
+ # Returns whether the current git branch is empty (has no commits).
690
+ #
691
+ # @return [true, false]
692
+ #
693
+ # source://overcommit//lib/overcommit/git_repo.rb#146
694
+ def initial_commit?; end
695
+
696
+ # Returns the names of files in the given paths that are tracked by git.
697
+ #
698
+ # @option options
699
+ # @param paths [Array<String>] list of paths to check
700
+ # @return [Array<String>] list of absolute file paths
701
+ #
702
+ # source://overcommit//lib/overcommit/git_repo.rb#110
703
+ def list_files(paths = T.unsafe(nil), options = T.unsafe(nil)); end
704
+
705
+ # Returns the names of all files that have been modified compared to HEAD.
706
+ #
707
+ # @param options [Hash]
708
+ # @return [Array<String>] list of absolute file paths
709
+ #
710
+ # source://overcommit//lib/overcommit/git_repo.rb#93
711
+ def modified_files(options); end
712
+
713
+ # Restore any relevant files that were present when repo was in the middle
714
+ # of a cherry-pick.
715
+ #
716
+ # source://overcommit//lib/overcommit/git_repo.rb#203
717
+ def restore_cherry_pick_state; end
718
+
719
+ # Restore any relevant files that were present when repo was in the middle
720
+ # of a merge.
721
+ #
722
+ # source://overcommit//lib/overcommit/git_repo.rb#183
723
+ def restore_merge_state; end
724
+
725
+ # Returns the submodules that have been staged for removal.
726
+ #
727
+ # `git` has an unexpected behavior where removing a submodule without
728
+ # committing (i.e. such that the submodule directory is removed and the
729
+ # changes to the index are staged) and then doing a hard reset results in
730
+ # the index being wiped but the empty directory of the once existent
731
+ # submodule being restored (but with no content).
732
+ #
733
+ # This prevents restoration of the stash of the submodule index changes,
734
+ # which breaks pre-commit hook restorations of the working index.
735
+ #
736
+ # Thus we expose this helper so the restoration code can manually delete the
737
+ # directory.
738
+ #
739
+ # @raise [Overcommit::Exceptions::GitSubmoduleError] when
740
+ #
741
+ # source://overcommit//lib/overcommit/git_repo.rb#231
742
+ def staged_submodule_removals; end
743
+
744
+ # Store any relevant files that are present when repo is in the middle of a
745
+ # cherry-pick.
746
+ #
747
+ # Restored via [#restore_cherry_pick_state].
748
+ #
749
+ # source://overcommit//lib/overcommit/git_repo.rb#171
750
+ def store_cherry_pick_state; end
751
+
752
+ # Store any relevant files that are present when repo is in the middle of a
753
+ # merge.
754
+ #
755
+ # Restored via [#restore_merge_state].
756
+ #
757
+ # source://overcommit//lib/overcommit/git_repo.rb#154
758
+ def store_merge_state; end
759
+
760
+ # Returns a list of SubmoduleStatus objects, one for each submodule in the
761
+ # parent repository.
762
+ #
763
+ # @option options
764
+ # @return [Array<SubmoduleStatus>]
765
+ #
766
+ # source://overcommit//lib/overcommit/git_repo.rb#53
767
+ def submodule_statuses(options = T.unsafe(nil)); end
768
+
769
+ # Returns the current set of registered submodules.
770
+ #
771
+ # @param options [Hash]
772
+ # @return [Array<Overcommit::GitRepo::Submodule>]
773
+ #
774
+ # source://overcommit//lib/overcommit/git_repo.rb#245
775
+ def submodules(options = T.unsafe(nil)); end
776
+
777
+ # Returns whether the specified file/path is tracked by this repository.
778
+ #
779
+ # @param path [String]
780
+ # @return [true, false]
781
+ #
782
+ # source://overcommit//lib/overcommit/git_repo.rb#130
783
+ def tracked?(path); end
784
+
785
+ class << self
786
+ # Returns the names of all files that are tracked by git.
787
+ #
788
+ # @return [Array<String>] list of absolute file paths
789
+ #
790
+ # source://overcommit//lib/overcommit/git_repo.rb#137
791
+ def all_files; end
792
+
793
+ # Returns the names of all branches containing the given commit.
794
+ #
795
+ # @param commit_ref [String] git tree ref that resolves to a commit
796
+ # @return [Array<String>] list of branches containing the given commit
797
+ #
798
+ # source://overcommit//lib/overcommit/git_repo.rb#274
799
+ def branches_containing_commit(commit_ref); end
800
+
801
+ # Returns the name of the currently checked out branch.
802
+ #
803
+ # @return [String]
804
+ #
805
+ # source://overcommit//lib/overcommit/git_repo.rb#283
806
+ def current_branch; end
807
+
808
+ # Extract the set of modified lines from a given file.
809
+ #
810
+ # @param file_path [String]
811
+ # @param options [Hash]
812
+ # @return [Set] line numbers that have been modified in file
813
+ #
814
+ # source://overcommit//lib/overcommit/git_repo.rb#68
815
+ def extract_modified_lines(file_path, options); end
816
+
817
+ # Returns whether the current git branch is empty (has no commits).
818
+ #
819
+ # @return [true, false]
820
+ #
821
+ # source://overcommit//lib/overcommit/git_repo.rb#146
822
+ def initial_commit?; end
823
+
824
+ # Returns the names of files in the given paths that are tracked by git.
825
+ #
826
+ # @option options
827
+ # @param paths [Array<String>] list of paths to check
828
+ # @param options [Hash] a customizable set of options
829
+ # @return [Array<String>] list of absolute file paths
830
+ #
831
+ # source://overcommit//lib/overcommit/git_repo.rb#110
832
+ def list_files(paths = T.unsafe(nil), options = T.unsafe(nil)); end
833
+
834
+ # Returns the names of all files that have been modified compared to HEAD.
835
+ #
836
+ # @param options [Hash]
837
+ # @return [Array<String>] list of absolute file paths
838
+ #
839
+ # source://overcommit//lib/overcommit/git_repo.rb#93
840
+ def modified_files(options); end
841
+
842
+ # Restore any relevant files that were present when repo was in the middle
843
+ # of a cherry-pick.
844
+ #
845
+ # source://overcommit//lib/overcommit/git_repo.rb#203
846
+ def restore_cherry_pick_state; end
847
+
848
+ # Restore any relevant files that were present when repo was in the middle
849
+ # of a merge.
850
+ #
851
+ # source://overcommit//lib/overcommit/git_repo.rb#183
852
+ def restore_merge_state; end
853
+
854
+ # Returns the submodules that have been staged for removal.
855
+ #
856
+ # `git` has an unexpected behavior where removing a submodule without
857
+ # committing (i.e. such that the submodule directory is removed and the
858
+ # changes to the index are staged) and then doing a hard reset results in
859
+ # the index being wiped but the empty directory of the once existent
860
+ # submodule being restored (but with no content).
861
+ #
862
+ # This prevents restoration of the stash of the submodule index changes,
863
+ # which breaks pre-commit hook restorations of the working index.
864
+ #
865
+ # Thus we expose this helper so the restoration code can manually delete the
866
+ # directory.
867
+ #
868
+ # @raise [Overcommit::Exceptions::GitSubmoduleError] when
869
+ #
870
+ # source://overcommit//lib/overcommit/git_repo.rb#231
871
+ def staged_submodule_removals; end
872
+
873
+ # Store any relevant files that are present when repo is in the middle of a
874
+ # cherry-pick.
875
+ #
876
+ # Restored via [#restore_cherry_pick_state].
877
+ #
878
+ # source://overcommit//lib/overcommit/git_repo.rb#171
879
+ def store_cherry_pick_state; end
880
+
881
+ # Store any relevant files that are present when repo is in the middle of a
882
+ # merge.
883
+ #
884
+ # Restored via [#restore_merge_state].
885
+ #
886
+ # source://overcommit//lib/overcommit/git_repo.rb#154
887
+ def store_merge_state; end
888
+
889
+ # Returns a list of SubmoduleStatus objects, one for each submodule in the
890
+ # parent repository.
891
+ #
892
+ # @option options
893
+ # @param options [Hash] a customizable set of options
894
+ # @return [Array<SubmoduleStatus>]
895
+ #
896
+ # source://overcommit//lib/overcommit/git_repo.rb#53
897
+ def submodule_statuses(options = T.unsafe(nil)); end
898
+
899
+ # Returns the current set of registered submodules.
900
+ #
901
+ # @param options [Hash]
902
+ # @return [Array<Overcommit::GitRepo::Submodule>]
903
+ #
904
+ # source://overcommit//lib/overcommit/git_repo.rb#245
905
+ def submodules(options = T.unsafe(nil)); end
906
+
907
+ # Returns whether the specified file/path is tracked by this repository.
908
+ #
909
+ # @param path [String]
910
+ # @return [true, false]
911
+ #
912
+ # source://overcommit//lib/overcommit/git_repo.rb#130
913
+ def tracked?(path); end
914
+ end
915
+ end
916
+
917
+ # Regular expression used to extract diff ranges from hunks of diff output.
918
+ #
919
+ # source://overcommit//lib/overcommit/git_repo.rb#12
920
+ Overcommit::GitRepo::DIFF_HUNK_REGEX = T.let(T.unsafe(nil), Regexp)
921
+
922
+ # Regular expression used to extract information from lines of
923
+ # `git submodule status` output
924
+ #
925
+ # source://overcommit//lib/overcommit/git_repo.rb#21
926
+ Overcommit::GitRepo::SUBMODULE_STATUS_REGEX = T.let(T.unsafe(nil), Regexp)
927
+
928
+ # Contains information about a registered submodule.
929
+ #
930
+ # source://overcommit//lib/overcommit/git_repo.rb#214
931
+ class Overcommit::GitRepo::Submodule < ::Struct
932
+ # Returns the value of attribute path
933
+ #
934
+ # @return [Object] the current value of path
935
+ def path; end
936
+
937
+ # Sets the attribute path
938
+ #
939
+ # @param value [Object] the value to set the attribute path to.
940
+ # @return [Object] the newly set value
941
+ def path=(_); end
942
+
943
+ # Returns the value of attribute url
944
+ #
945
+ # @return [Object] the current value of url
946
+ def url; end
947
+
948
+ # Sets the attribute url
949
+ #
950
+ # @param value [Object] the value to set the attribute url to.
951
+ # @return [Object] the newly set value
952
+ def url=(_); end
953
+
954
+ class << self
955
+ def [](*_arg0); end
956
+ def inspect; end
957
+ def keyword_init?; end
958
+ def members; end
959
+ def new(*_arg0); end
960
+ end
961
+ end
962
+
963
+ # Struct encapsulating submodule information extracted from the
964
+ # output of `git submodule status`
965
+ #
966
+ # source://overcommit//lib/overcommit/git_repo.rb#29
967
+ class Overcommit::GitRepo::SubmoduleStatus < ::Struct
968
+ # Returns the value of attribute describe
969
+ #
970
+ # @return [Object] the current value of describe
971
+ def describe; end
972
+
973
+ # Sets the attribute describe
974
+ #
975
+ # @param value [Object] the value to set the attribute describe to.
976
+ # @return [Object] the newly set value
977
+ def describe=(_); end
978
+
979
+ # Returns whether the submodule reference has a merge conflict
980
+ #
981
+ # @return [Boolean]
982
+ #
983
+ # source://overcommit//lib/overcommit/git_repo.rb#43
984
+ def merge_conflict?; end
985
+
986
+ # Returns whether the submodule is out of date with the current
987
+ # index, i.e. its checked-out commit differs from that stored in
988
+ # the index of the parent repo
989
+ #
990
+ # @return [Boolean]
991
+ #
992
+ # source://overcommit//lib/overcommit/git_repo.rb#38
993
+ def outdated?; end
994
+
995
+ # Returns the value of attribute path
996
+ #
997
+ # @return [Object] the current value of path
998
+ def path; end
999
+
1000
+ # Sets the attribute path
1001
+ #
1002
+ # @param value [Object] the value to set the attribute path to.
1003
+ # @return [Object] the newly set value
1004
+ def path=(_); end
1005
+
1006
+ # Returns the value of attribute prefix
1007
+ #
1008
+ # @return [Object] the current value of prefix
1009
+ def prefix; end
1010
+
1011
+ # Sets the attribute prefix
1012
+ #
1013
+ # @param value [Object] the value to set the attribute prefix to.
1014
+ # @return [Object] the newly set value
1015
+ def prefix=(_); end
1016
+
1017
+ # Returns the value of attribute sha1
1018
+ #
1019
+ # @return [Object] the current value of sha1
1020
+ def sha1; end
1021
+
1022
+ # Sets the attribute sha1
1023
+ #
1024
+ # @param value [Object] the value to set the attribute sha1 to.
1025
+ # @return [Object] the newly set value
1026
+ def sha1=(_); end
1027
+
1028
+ # Returns whether the submodule has not been initialized
1029
+ #
1030
+ # @return [Boolean]
1031
+ #
1032
+ # source://overcommit//lib/overcommit/git_repo.rb#31
1033
+ def uninitialized?; end
1034
+
1035
+ class << self
1036
+ def [](*_arg0); end
1037
+ def inspect; end
1038
+ def keyword_init?; end
1039
+ def members; end
1040
+ def new(*_arg0); end
1041
+ end
1042
+ end
1043
+
1044
+ # source://overcommit//lib/overcommit/constants.rb#5
1045
+ Overcommit::HOME = T.let(T.unsafe(nil), String)
1046
+
1047
+ # source://overcommit//lib/overcommit/constants.rb#9
1048
+ Overcommit::HOOK_DIRECTORY = T.let(T.unsafe(nil), String)
1049
+
1050
+ # Container for top-level hook-related classes and constants.
1051
+ #
1052
+ # source://overcommit//lib/overcommit/hook/base.rb#7
1053
+ module Overcommit::Hook; end
1054
+
1055
+ # Functionality common to all hooks.
1056
+ #
1057
+ # source://overcommit//lib/overcommit/hook/base.rb#19
1058
+ class Overcommit::Hook::Base
1059
+ extend ::Forwardable
1060
+
1061
+ # @param config [Overcommit::Configuration]
1062
+ # @param context [Overcommit::HookContext]
1063
+ # @return [Base] a new instance of Base
1064
+ #
1065
+ # source://overcommit//lib/overcommit/hook/base.rb#27
1066
+ def initialize(config, context); end
1067
+
1068
+ # source://forwardable/1.3.3/forwardable.rb#231
1069
+ def all_files(*args, **_arg1, &block); end
1070
+
1071
+ # Gets a list of staged files that apply to this hook based on its
1072
+ # configured `include` and `exclude` lists.
1073
+ #
1074
+ # source://overcommit//lib/overcommit/hook/base.rb#165
1075
+ def applicable_files; end
1076
+
1077
+ # Return command to execute for this hook.
1078
+ #
1079
+ # This is intended to be configurable so hooks can prefix their commands
1080
+ # with `bundle exec` or similar. It will appends the command line flags
1081
+ # specified by the `flags` option after.
1082
+ #
1083
+ # Note that any files intended to be passed must be handled by the hook
1084
+ # itself.
1085
+ #
1086
+ # @return [Array<String>]
1087
+ #
1088
+ # source://overcommit//lib/overcommit/hook/base.rb#141
1089
+ def command; end
1090
+
1091
+ # Returns the value of attribute config.
1092
+ #
1093
+ # source://overcommit//lib/overcommit/hook/base.rb#23
1094
+ def config; end
1095
+
1096
+ # source://overcommit//lib/overcommit/hook/base.rb#58
1097
+ def description; end
1098
+
1099
+ # @return [Boolean]
1100
+ #
1101
+ # source://overcommit//lib/overcommit/hook/base.rb#78
1102
+ def enabled?; end
1103
+
1104
+ # @return [Boolean]
1105
+ #
1106
+ # source://overcommit//lib/overcommit/hook/base.rb#82
1107
+ def excluded?; end
1108
+
1109
+ # Execute a command in a separate process.
1110
+ #
1111
+ # If `splittable_args` is specified, ensures that those arguments are
1112
+ # concatenated onto the end of the `cmd` arguments, but split up so that the
1113
+ # operating system's maximum command length is not exceeded. This is useful
1114
+ # for splitting up long file lists.
1115
+ #
1116
+ # @option options
1117
+ # @option options
1118
+ # @param cmd [Array<String>] command arguments
1119
+ # @param options [Hash]
1120
+ # @return [#status, #stdout, #stderr] struct containing result of invocation
1121
+ #
1122
+ # source://overcommit//lib/overcommit/hook/base.rb#115
1123
+ def execute(cmd, options = T.unsafe(nil)); end
1124
+
1125
+ # source://overcommit//lib/overcommit/hook/base.rb#119
1126
+ def execute_in_background(cmd); end
1127
+
1128
+ # Return command line flags to be passed to the command.
1129
+ #
1130
+ # This excludes the list of files, as that must be handled by the hook
1131
+ # itself.
1132
+ #
1133
+ # The intention here is to provide flexibility for when a tool
1134
+ # removes/renames its flags. Rather than wait for Overcommit to update the
1135
+ # flags it uses, you can update your configuration to use the new flags
1136
+ # right away without being blocked.
1137
+ #
1138
+ # Also note that any flags containing dynamic content must be passed in the
1139
+ # hook's {#run} method.
1140
+ #
1141
+ # @return [Array<String>]
1142
+ #
1143
+ # source://overcommit//lib/overcommit/hook/base.rb#159
1144
+ def flags; end
1145
+
1146
+ # @return [Boolean]
1147
+ #
1148
+ # source://overcommit//lib/overcommit/hook/base.rb#97
1149
+ def in_path?(cmd); end
1150
+
1151
+ # Gets a list of all files that apply to this hook based on its
1152
+ # configured `include` and `exclude` lists.
1153
+ #
1154
+ # source://overcommit//lib/overcommit/hook/base.rb#171
1155
+ def included_files; end
1156
+
1157
+ # source://forwardable/1.3.3/forwardable.rb#231
1158
+ def modified_files(*args, **_arg1, &block); end
1159
+
1160
+ # source://overcommit//lib/overcommit/hook/base.rb#54
1161
+ def name; end
1162
+
1163
+ # @return [Boolean]
1164
+ #
1165
+ # source://overcommit//lib/overcommit/hook/base.rb#66
1166
+ def parallelize?; end
1167
+
1168
+ # source://overcommit//lib/overcommit/hook/base.rb#70
1169
+ def processors; end
1170
+
1171
+ # @return [Boolean]
1172
+ #
1173
+ # source://overcommit//lib/overcommit/hook/base.rb#74
1174
+ def quiet?; end
1175
+
1176
+ # @return [Boolean]
1177
+ #
1178
+ # source://overcommit//lib/overcommit/hook/base.rb#62
1179
+ def required?; end
1180
+
1181
+ # source://overcommit//lib/overcommit/hook/base.rb#123
1182
+ def required_executable; end
1183
+
1184
+ # source://overcommit//lib/overcommit/hook/base.rb#127
1185
+ def required_libraries; end
1186
+
1187
+ # Runs the hook.
1188
+ #
1189
+ # @raise [NotImplementedError]
1190
+ #
1191
+ # source://overcommit//lib/overcommit/hook/base.rb#33
1192
+ def run; end
1193
+
1194
+ # @return [Boolean]
1195
+ #
1196
+ # source://overcommit//lib/overcommit/hook/base.rb#91
1197
+ def run?; end
1198
+
1199
+ # Runs the hook and transforms the status returned based on the hook's
1200
+ # configuration.
1201
+ #
1202
+ # Poorly named because we already have a bunch of hooks in the wild that
1203
+ # implement `#run`, and we needed a wrapper step to transform the status
1204
+ # based on any custom configuration.
1205
+ #
1206
+ # source://overcommit//lib/overcommit/hook/base.rb#43
1207
+ def run_and_transform; end
1208
+
1209
+ # @return [Boolean]
1210
+ #
1211
+ # source://overcommit//lib/overcommit/hook/base.rb#86
1212
+ def skip?; end
1213
+
1214
+ private
1215
+
1216
+ # @return [Boolean]
1217
+ #
1218
+ # source://overcommit//lib/overcommit/hook/base.rb#181
1219
+ def applicable_file?(file); end
1220
+
1221
+ # If the hook defines a required executable, check if it's in the path and
1222
+ # display the install command if one exists.
1223
+ #
1224
+ # source://overcommit//lib/overcommit/hook/base.rb#210
1225
+ def check_for_executable; end
1226
+
1227
+ # If the hook defines required library paths that it wants to load, attempt
1228
+ # to load them.
1229
+ #
1230
+ # source://overcommit//lib/overcommit/hook/base.rb#227
1231
+ def check_for_libraries; end
1232
+
1233
+ # Check for any required executables or libraries.
1234
+ #
1235
+ # Returns output if any requirements are not met.
1236
+ #
1237
+ # source://overcommit//lib/overcommit/hook/base.rb#204
1238
+ def check_for_requirements; end
1239
+
1240
+ # source://overcommit//lib/overcommit/hook/base.rb#290
1241
+ def current_branch; end
1242
+
1243
+ # source://overcommit//lib/overcommit/hook/base.rb#286
1244
+ def exclude_branches; end
1245
+
1246
+ # source://overcommit//lib/overcommit/hook/base.rb#217
1247
+ def install_command_prompt; end
1248
+
1249
+ # Converts the hook's return value into a canonical form of a tuple
1250
+ # containing status (pass/warn/fail) and output.
1251
+ #
1252
+ # This is intended to support various shortcuts for writing hooks so that
1253
+ # hook authors don't need to work with {Overcommit::Hook::Message} objects
1254
+ # for simple pass/fail hooks. It also saves you from needing to manually
1255
+ # encode logic like "if there are errors, fail; if there are warnings, warn,
1256
+ # otherwise pass." by simply returning an array of
1257
+ # {Overcommit::Hook::Message} objects.
1258
+ #
1259
+ # @param hook_return_value [Symbol, Array<Symbol,String>, Array<Message>]
1260
+ # @return [Array<Symbol,String>] tuple of status and output
1261
+ #
1262
+ # source://overcommit//lib/overcommit/hook/base.rb#258
1263
+ def process_hook_return_value(hook_return_value); end
1264
+
1265
+ # source://overcommit//lib/overcommit/hook/base.rb#177
1266
+ def select_applicable(list); end
1267
+
1268
+ # Transforms the hook's status based on custom configuration.
1269
+ #
1270
+ # This allows users to change failures into warnings, or vice versa.
1271
+ #
1272
+ # source://overcommit//lib/overcommit/hook/base.rb#275
1273
+ def transform_status(status); end
1274
+ end
1275
+
1276
+ # Possible types of messages.
1277
+ #
1278
+ # source://overcommit//lib/overcommit/hook/base.rb#16
1279
+ Overcommit::Hook::MESSAGE_TYPES = T.let(T.unsafe(nil), Array)
1280
+
1281
+ # Helper containing metadata about error/warning messages returned by hooks.
1282
+ #
1283
+ # source://overcommit//lib/overcommit/hook/base.rb#9
1284
+ class Overcommit::Hook::Message < ::Struct
1285
+ # Returns the value of attribute content
1286
+ #
1287
+ # @return [Object] the current value of content
1288
+ def content; end
1289
+
1290
+ # Sets the attribute content
1291
+ #
1292
+ # @param value [Object] the value to set the attribute content to.
1293
+ # @return [Object] the newly set value
1294
+ def content=(_); end
1295
+
1296
+ # Returns the value of attribute file
1297
+ #
1298
+ # @return [Object] the current value of file
1299
+ def file; end
1300
+
1301
+ # Sets the attribute file
1302
+ #
1303
+ # @param value [Object] the value to set the attribute file to.
1304
+ # @return [Object] the newly set value
1305
+ def file=(_); end
1306
+
1307
+ # Returns the value of attribute line
1308
+ #
1309
+ # @return [Object] the current value of line
1310
+ def line; end
1311
+
1312
+ # Sets the attribute line
1313
+ #
1314
+ # @param value [Object] the value to set the attribute line to.
1315
+ # @return [Object] the newly set value
1316
+ def line=(_); end
1317
+
1318
+ # source://overcommit//lib/overcommit/hook/base.rb#10
1319
+ def to_s; end
1320
+
1321
+ # Returns the value of attribute type
1322
+ #
1323
+ # @return [Object] the current value of type
1324
+ def type; end
1325
+
1326
+ # Sets the attribute type
1327
+ #
1328
+ # @param value [Object] the value to set the attribute type to.
1329
+ # @return [Object] the newly set value
1330
+ def type=(_); end
1331
+
1332
+ class << self
1333
+ def [](*_arg0); end
1334
+ def inspect; end
1335
+ def keyword_init?; end
1336
+ def members; end
1337
+ def new(*_arg0); end
1338
+ end
1339
+ end
1340
+
1341
+ # Utility module which manages the creation of {HookContext}s.
1342
+ #
1343
+ # source://overcommit//lib/overcommit/hook_context/base.rb#3
1344
+ module Overcommit::HookContext
1345
+ class << self
1346
+ # source://overcommit//lib/overcommit/hook_context.rb#5
1347
+ def create(hook_type, config, args, input); end
1348
+ end
1349
+ end
1350
+
1351
+ # Contains helpers related to the context with which a hook is being run.
1352
+ #
1353
+ # It acts as an adapter to the arguments passed to the hook, as well as
1354
+ # context-specific information such as staged files, providing a single source
1355
+ # of truth for this context.
1356
+ #
1357
+ # This is also important to house in a separate object so that any
1358
+ # calculations can be memoized across all hooks in a single object, which
1359
+ # helps with performance.
1360
+ #
1361
+ # @abstract
1362
+ #
1363
+ # source://overcommit//lib/overcommit/hook_context/base.rb#15
1364
+ class Overcommit::HookContext::Base
1365
+ # Creates a hook context from the given configuration and input options.
1366
+ #
1367
+ # @param config [Overcommit::Configuration]
1368
+ # @param args [Array<String>]
1369
+ # @param input [IO] standard input stream
1370
+ # @return [Base] a new instance of Base
1371
+ #
1372
+ # source://overcommit//lib/overcommit/hook_context/base.rb#21
1373
+ def initialize(config, args, input); end
1374
+
1375
+ # Returns the full list of files tracked by git
1376
+ #
1377
+ # @return [Array<String>]
1378
+ #
1379
+ # source://overcommit//lib/overcommit/hook_context/base.rb#87
1380
+ def all_files; end
1381
+
1382
+ # Resets the environment to an appropriate state.
1383
+ #
1384
+ # This is called after the hooks have been run by the [HookRunner].
1385
+ # Different hook types can perform different cleanup operations, which are
1386
+ # intended to "undo" the results of the call to {#setup_environment}.
1387
+ #
1388
+ # source://overcommit//lib/overcommit/hook_context/base.rb#70
1389
+ def cleanup_environment; end
1390
+
1391
+ # Executes a command as if it were a regular git hook, passing all
1392
+ # command-line arguments and the standard input stream.
1393
+ #
1394
+ # This is intended to be used by ad hoc hooks so developers can link up
1395
+ # their existing git hooks with Overcommit.
1396
+ #
1397
+ # source://overcommit//lib/overcommit/hook_context/base.rb#32
1398
+ def execute_hook(command); end
1399
+
1400
+ # Returns the camel-cased type of this hook (e.g. PreCommit)
1401
+ #
1402
+ # @return [String]
1403
+ #
1404
+ # source://overcommit//lib/overcommit/hook_context/base.rb#39
1405
+ def hook_class_name; end
1406
+
1407
+ # Returns the actual name of the hook script being run (e.g. pre-commit).
1408
+ #
1409
+ # @return [String]
1410
+ #
1411
+ # source://overcommit//lib/overcommit/hook_context/base.rb#53
1412
+ def hook_script_name; end
1413
+
1414
+ # Returns the snake-cased type of this hook (e.g. pre_commit)
1415
+ #
1416
+ # @return [String]
1417
+ #
1418
+ # source://overcommit//lib/overcommit/hook_context/base.rb#46
1419
+ def hook_type_name; end
1420
+
1421
+ # Returns an array of lines passed to the hook via the standard input
1422
+ # stream.
1423
+ #
1424
+ # @return [Array<String>]
1425
+ #
1426
+ # source://overcommit//lib/overcommit/hook_context/base.rb#103
1427
+ def input_lines; end
1428
+
1429
+ # Returns the contents of the entire standard input stream that were passed
1430
+ # to the hook.
1431
+ #
1432
+ # @return [String]
1433
+ #
1434
+ # source://overcommit//lib/overcommit/hook_context/base.rb#95
1435
+ def input_string; end
1436
+
1437
+ # Returns a list of files that have been modified.
1438
+ #
1439
+ # By default, this returns an empty list. Subclasses should implement if
1440
+ # there is a concept of files changing for the type of hook being run.
1441
+ #
1442
+ # @return [Array<String>]
1443
+ #
1444
+ # source://overcommit//lib/overcommit/hook_context/base.rb#80
1445
+ def modified_files; end
1446
+
1447
+ # Returns a message to display on failure.
1448
+ #
1449
+ # @return [String]
1450
+ #
1451
+ # source://overcommit//lib/overcommit/hook_context/base.rb#110
1452
+ def post_fail_message; end
1453
+
1454
+ # Initializes anything related to the environment.
1455
+ #
1456
+ # This is called before the hooks are run by the [HookRunner]. Different
1457
+ # hook types can perform different setup.
1458
+ #
1459
+ # source://overcommit//lib/overcommit/hook_context/base.rb#61
1460
+ def setup_environment; end
1461
+
1462
+ private
1463
+
1464
+ # Filter out directories. This could happen when changing a symlink to a
1465
+ # directory as part of an amendment, since the symlink will still appear as
1466
+ # a file, but the actual working tree will have a directory.
1467
+ #
1468
+ # source://overcommit//lib/overcommit/hook_context/base.rb#133
1469
+ def filter_directories(modified_files); end
1470
+
1471
+ # source://overcommit//lib/overcommit/hook_context/base.rb#116
1472
+ def filter_modified_files(modified_files); end
1473
+
1474
+ # Filter out non-existent files (unless it's a broken symlink, in which case
1475
+ # it's a file that points to a non-existent file). This could happen if a
1476
+ # file was renamed as part of an amendment, leading to the old file no
1477
+ # longer existing.
1478
+ #
1479
+ # source://overcommit//lib/overcommit/hook_context/base.rb#124
1480
+ def filter_nonexistent(modified_files); end
1481
+ end
1482
+
1483
+ # source://overcommit//lib/overcommit/hook_loader/base.rb#3
1484
+ module Overcommit::HookLoader; end
1485
+
1486
+ # Responsible for loading hooks from a file.
1487
+ #
1488
+ # source://overcommit//lib/overcommit/hook_loader/base.rb#5
1489
+ class Overcommit::HookLoader::Base
1490
+ # @param config [Overcommit::Configuration]
1491
+ # @param context [Overcommit::HookContext]
1492
+ # @param logger [Overcommit::Logger]
1493
+ # @return [Base] a new instance of Base
1494
+ #
1495
+ # source://overcommit//lib/overcommit/hook_loader/base.rb#9
1496
+ def initialize(config, context, logger); end
1497
+
1498
+ # When implemented in subclasses, loads the hooks for which that subclass is
1499
+ # responsible.
1500
+ #
1501
+ # @raise [NotImplementedError]
1502
+ # @return [Array<Hook>]
1503
+ #
1504
+ # source://overcommit//lib/overcommit/hook_loader/base.rb#19
1505
+ def load_hooks; end
1506
+
1507
+ private
1508
+
1509
+ # Load and return a {Hook} from a CamelCase hook name.
1510
+ #
1511
+ # source://overcommit//lib/overcommit/hook_loader/base.rb#28
1512
+ def create_hook(hook_name); end
1513
+
1514
+ # Returns the value of attribute log.
1515
+ #
1516
+ # source://overcommit//lib/overcommit/hook_loader/base.rb#25
1517
+ def log; end
1518
+ end
1519
+
1520
+ # Responsible for loading hooks that ship with Overcommit.
1521
+ #
1522
+ # source://overcommit//lib/overcommit/hook_loader/built_in_hook_loader.rb#5
1523
+ class Overcommit::HookLoader::BuiltInHookLoader < ::Overcommit::HookLoader::Base
1524
+ # source://overcommit//lib/overcommit/hook_loader/built_in_hook_loader.rb#6
1525
+ def load_hooks; end
1526
+ end
1527
+
1528
+ # Responsible for loading hooks that are specific to the repository Overcommit
1529
+ # is running in.
1530
+ #
1531
+ # source://overcommit//lib/overcommit/hook_loader/plugin_hook_loader.rb#8
1532
+ class Overcommit::HookLoader::PluginHookLoader < ::Overcommit::HookLoader::Base
1533
+ # source://overcommit//lib/overcommit/hook_loader/plugin_hook_loader.rb#9
1534
+ def load_hooks; end
1535
+
1536
+ # source://overcommit//lib/overcommit/hook_loader/plugin_hook_loader.rb#24
1537
+ def update_signatures; end
1538
+
1539
+ private
1540
+
1541
+ # source://overcommit//lib/overcommit/hook_loader/plugin_hook_loader.rb#46
1542
+ def ad_hoc_hook_names; end
1543
+
1544
+ # @raise [Overcommit::Exceptions::InvalidHookSignature]
1545
+ #
1546
+ # source://overcommit//lib/overcommit/hook_loader/plugin_hook_loader.rb#56
1547
+ def check_for_modified_plugins; end
1548
+
1549
+ # source://overcommit//lib/overcommit/hook_loader/plugin_hook_loader.rb#77
1550
+ def create_ad_hoc_hook(hook_name); end
1551
+
1552
+ # source://overcommit//lib/overcommit/hook_loader/plugin_hook_loader.rb#50
1553
+ def modified_plugins; end
1554
+
1555
+ # source://overcommit//lib/overcommit/hook_loader/plugin_hook_loader.rb#40
1556
+ def plugin_hook_names; end
1557
+
1558
+ # source://overcommit//lib/overcommit/hook_loader/plugin_hook_loader.rb#35
1559
+ def plugin_paths; end
1560
+ end
1561
+
1562
+ # Responsible for loading the hooks the repository has configured and running
1563
+ # them, collecting and displaying the results.
1564
+ #
1565
+ # source://overcommit//lib/overcommit/hook_runner.rb#6
1566
+ class Overcommit::HookRunner
1567
+ # @param config [Overcommit::Configuration]
1568
+ # @param logger [Overcommit::Logger]
1569
+ # @param context [Overcommit::HookContext]
1570
+ # @param printer [Overcommit::Printer]
1571
+ # @return [HookRunner] a new instance of HookRunner
1572
+ #
1573
+ # source://overcommit//lib/overcommit/hook_runner.rb#11
1574
+ def initialize(config, logger, context, printer); end
1575
+
1576
+ # Loads and runs the hooks registered for this {HookRunner}.
1577
+ #
1578
+ # source://overcommit//lib/overcommit/hook_runner.rb#24
1579
+ def run; end
1580
+
1581
+ private
1582
+
1583
+ # source://overcommit//lib/overcommit/hook_runner.rb#93
1584
+ def consume; end
1585
+
1586
+ # source://overcommit//lib/overcommit/hook_runner.rb#199
1587
+ def load_hooks; end
1588
+
1589
+ # Returns the value of attribute log.
1590
+ #
1591
+ # source://overcommit//lib/overcommit/hook_runner.rb#54
1592
+ def log; end
1593
+
1594
+ # source://overcommit//lib/overcommit/hook_runner.rb#143
1595
+ def print_results; end
1596
+
1597
+ # source://overcommit//lib/overcommit/hook_runner.rb#139
1598
+ def processors_for_hook(hook); end
1599
+
1600
+ # source://overcommit//lib/overcommit/hook_runner.rb#128
1601
+ def release_slot(hook); end
1602
+
1603
+ # source://overcommit//lib/overcommit/hook_runner.rb#155
1604
+ def run_hook(hook); end
1605
+
1606
+ # source://overcommit//lib/overcommit/hook_runner.rb#56
1607
+ def run_hooks; end
1608
+
1609
+ # @return [Boolean]
1610
+ #
1611
+ # source://overcommit//lib/overcommit/hook_runner.rb#183
1612
+ def should_skip?(hook); end
1613
+
1614
+ # source://overcommit//lib/overcommit/hook_runner.rb#102
1615
+ def wait_for_slot(hook); end
1616
+ end
1617
+
1618
+ # Calculates, stores, and retrieves stored signatures of hook plugins.
1619
+ #
1620
+ # source://overcommit//lib/overcommit/hook_signer.rb#5
1621
+ class Overcommit::HookSigner
1622
+ # @param hook_name [String] name of the hook
1623
+ # @param config [Overcommit::Configuration]
1624
+ # @param context [Overcommit::HookContext]
1625
+ # @return [HookSigner] a new instance of HookSigner
1626
+ #
1627
+ # source://overcommit//lib/overcommit/hook_signer.rb#15
1628
+ def initialize(hook_name, config, context); end
1629
+
1630
+ # Returns the value of attribute hook_name.
1631
+ #
1632
+ # source://overcommit//lib/overcommit/hook_signer.rb#6
1633
+ def hook_name; end
1634
+
1635
+ # Returns the path of the file that should be incorporated into this hooks
1636
+ # signature.
1637
+ #
1638
+ # @return [String]
1639
+ #
1640
+ # source://overcommit//lib/overcommit/hook_signer.rb#25
1641
+ def hook_path; end
1642
+
1643
+ # @return [Boolean]
1644
+ #
1645
+ # source://overcommit//lib/overcommit/hook_signer.rb#53
1646
+ def signable_file?(file); end
1647
+
1648
+ # Return whether the signature for this hook has changed since it was last
1649
+ # calculated.
1650
+ #
1651
+ # @return [true, false]
1652
+ #
1653
+ # source://overcommit//lib/overcommit/hook_signer.rb#65
1654
+ def signature_changed?; end
1655
+
1656
+ # Update the current stored signature for this hook.
1657
+ #
1658
+ # source://overcommit//lib/overcommit/hook_signer.rb#70
1659
+ def update_signature!; end
1660
+
1661
+ private
1662
+
1663
+ # source://overcommit//lib/overcommit/hook_signer.rb#101
1664
+ def hook_contents; end
1665
+
1666
+ # Calculates a hash of a hook using a combination of its configuration and
1667
+ # file contents.
1668
+ #
1669
+ # This way, if either the plugin code changes or its configuration changes,
1670
+ # the hash will change and we can alert the user to this change.
1671
+ #
1672
+ # source://overcommit//lib/overcommit/hook_signer.rb#88
1673
+ def signature; end
1674
+
1675
+ # source://overcommit//lib/overcommit/hook_signer.rb#120
1676
+ def signature_config_key; end
1677
+
1678
+ # source://overcommit//lib/overcommit/hook_signer.rb#105
1679
+ def stored_signature; end
1680
+ end
1681
+
1682
+ # We don't want to include the skip setting as it is set by Overcommit
1683
+ # itself
1684
+ #
1685
+ # source://overcommit//lib/overcommit/hook_signer.rb#10
1686
+ Overcommit::HookSigner::IGNORED_CONFIG_KEYS = T.let(T.unsafe(nil), Array)
1687
+
1688
+ # Manages the installation of Overcommit hooks in a git repository.
1689
+ #
1690
+ # source://overcommit//lib/overcommit/installer.rb#7
1691
+ class Overcommit::Installer
1692
+ # @return [Installer] a new instance of Installer
1693
+ #
1694
+ # source://overcommit//lib/overcommit/installer.rb#11
1695
+ def initialize(logger); end
1696
+
1697
+ # source://overcommit//lib/overcommit/installer.rb#15
1698
+ def run(target, options); end
1699
+
1700
+ private
1701
+
1702
+ # @return [Boolean]
1703
+ #
1704
+ # source://overcommit//lib/overcommit/installer.rb#125
1705
+ def can_replace_file?(file); end
1706
+
1707
+ # Returns the configuration for this repository.
1708
+ #
1709
+ # source://overcommit//lib/overcommit/installer.rb#190
1710
+ def config(options = T.unsafe(nil)); end
1711
+
1712
+ # source://overcommit//lib/overcommit/installer.rb#81
1713
+ def ensure_directory(path); end
1714
+
1715
+ # source://overcommit//lib/overcommit/installer.rb#69
1716
+ def hooks_path; end
1717
+
1718
+ # source://overcommit//lib/overcommit/installer.rb#32
1719
+ def install; end
1720
+
1721
+ # source://overcommit//lib/overcommit/installer.rb#110
1722
+ def install_hook_files; end
1723
+
1724
+ # source://overcommit//lib/overcommit/installer.rb#101
1725
+ def install_master_hook; end
1726
+
1727
+ # source://overcommit//lib/overcommit/installer.rb#173
1728
+ def install_starter_config; end
1729
+
1730
+ # Returns the value of attribute log.
1731
+ #
1732
+ # source://overcommit//lib/overcommit/installer.rb#30
1733
+ def log; end
1734
+
1735
+ # source://overcommit//lib/overcommit/installer.rb#77
1736
+ def master_hook_install_path; end
1737
+
1738
+ # source://overcommit//lib/overcommit/installer.rb#73
1739
+ def old_hooks_path; end
1740
+
1741
+ # @return [Boolean]
1742
+ #
1743
+ # source://overcommit//lib/overcommit/installer.rb#181
1744
+ def overcommit_hook?(file); end
1745
+
1746
+ # source://overcommit//lib/overcommit/installer.rb#131
1747
+ def preserve_old_hooks; end
1748
+
1749
+ # source://overcommit//lib/overcommit/installer.rb#147
1750
+ def restore_old_hooks; end
1751
+
1752
+ # source://overcommit//lib/overcommit/installer.rb#47
1753
+ def uninstall; end
1754
+
1755
+ # source://overcommit//lib/overcommit/installer.rb#163
1756
+ def uninstall_hook_files; end
1757
+
1758
+ # source://overcommit//lib/overcommit/installer.rb#106
1759
+ def uninstall_master_hook; end
1760
+
1761
+ # @return [true, false] whether the hooks were updated
1762
+ #
1763
+ # source://overcommit//lib/overcommit/installer.rb#58
1764
+ def update; end
1765
+
1766
+ # source://overcommit//lib/overcommit/installer.rb#85
1767
+ def validate_target; end
1768
+ end
1769
+
1770
+ # source://overcommit//lib/overcommit/installer.rb#9
1771
+ Overcommit::Installer::MASTER_HOOK = T.let(T.unsafe(nil), String)
1772
+
1773
+ # source://overcommit//lib/overcommit/installer.rb#8
1774
+ Overcommit::Installer::TEMPLATE_DIRECTORY = T.let(T.unsafe(nil), String)
1775
+
1776
+ # source://overcommit//lib/overcommit/constants.rb#7
1777
+ Overcommit::LOCAL_CONFIG_FILE_NAME = T.let(T.unsafe(nil), String)
1778
+
1779
+ # Encapsulates all communication to an output source.
1780
+ #
1781
+ # source://overcommit//lib/overcommit/logger.rb#5
1782
+ class Overcommit::Logger
1783
+ # Creates a logger that will write to the given output stream.
1784
+ #
1785
+ # @param out [IO]
1786
+ # @return [Logger] a new instance of Logger
1787
+ #
1788
+ # source://overcommit//lib/overcommit/logger.rb#14
1789
+ def initialize(out); end
1790
+
1791
+ # Write a line of output that is intended to be emphasized.
1792
+ #
1793
+ # source://overcommit//lib/overcommit/logger.rb#52
1794
+ def bold(*args); end
1795
+
1796
+ # Write a line of output indicating a problem or error which is emphasized
1797
+ # over a regular problem or error.
1798
+ #
1799
+ # source://overcommit//lib/overcommit/logger.rb#63
1800
+ def bold_error(*args); end
1801
+
1802
+ # Write a line of output indicating a potential cause for concern, but with
1803
+ # greater emphasize compared to other warnings.
1804
+ #
1805
+ # source://overcommit//lib/overcommit/logger.rb#80
1806
+ def bold_warning(*args); end
1807
+
1808
+ # Write a line of output if debug mode is enabled.
1809
+ #
1810
+ # source://overcommit//lib/overcommit/logger.rb#47
1811
+ def debug(*args); end
1812
+
1813
+ # Write a line of output indicating a problem or error.
1814
+ #
1815
+ # source://overcommit//lib/overcommit/logger.rb#57
1816
+ def error(*args); end
1817
+
1818
+ # Flushes the [IO] object for partial lines
1819
+ #
1820
+ # source://overcommit//lib/overcommit/logger.rb#35
1821
+ def flush; end
1822
+
1823
+ # Write a line of output.
1824
+ #
1825
+ # A newline character will always be appended.
1826
+ #
1827
+ # source://overcommit//lib/overcommit/logger.rb#42
1828
+ def log(*args); end
1829
+
1830
+ # Prints a newline character (alias for readability).
1831
+ #
1832
+ # source://overcommit//lib/overcommit/logger.rb#30
1833
+ def newline; end
1834
+
1835
+ # Write output without a trailing newline.
1836
+ #
1837
+ # source://overcommit//lib/overcommit/logger.rb#25
1838
+ def partial(*args); end
1839
+
1840
+ # Write a line of output indicating a successful or noteworthy event.
1841
+ #
1842
+ # source://overcommit//lib/overcommit/logger.rb#68
1843
+ def success(*args); end
1844
+
1845
+ # Write a line of output indicating a potential cause for concern, but not
1846
+ # an actual error.
1847
+ #
1848
+ # source://overcommit//lib/overcommit/logger.rb#74
1849
+ def warning(*args); end
1850
+
1851
+ private
1852
+
1853
+ # Outputs text wrapped in ANSI escape code necessary to produce a given
1854
+ # color/text display.
1855
+ #
1856
+ # @param code [String] ANSI escape code, e.g. '1;33' for "bold yellow"
1857
+ # @param str [String] string to wrap
1858
+ # @param partial [true, false] whether to omit a newline
1859
+ #
1860
+ # source://overcommit//lib/overcommit/logger.rb#92
1861
+ def color(code, str, partial = T.unsafe(nil)); end
1862
+
1863
+ class << self
1864
+ # Helper for creating a logger which outputs nothing.
1865
+ #
1866
+ # source://overcommit//lib/overcommit/logger.rb#7
1867
+ def silent; end
1868
+ end
1869
+ end
1870
+
1871
+ # Utility class that encapsulates the handling of hook messages and whether
1872
+ # they affect lines the user has modified or not.
1873
+ #
1874
+ # This class exposes an endpoint that extracts an appropriate hook/status
1875
+ # output tuple from an array of {Overcommit::Hook::Message}s, respecting the
1876
+ # configuration settings for the given hook.
1877
+ #
1878
+ # source://overcommit//lib/overcommit/message_processor.rb#10
1879
+ class Overcommit::MessageProcessor
1880
+ # @param hook [Overcommit::Hook::Base]
1881
+ # @param unmodified_lines_setting [String] how to treat messages on
1882
+ # unmodified lines
1883
+ # @return [MessageProcessor] a new instance of MessageProcessor
1884
+ #
1885
+ # source://overcommit//lib/overcommit/message_processor.rb#21
1886
+ def initialize(hook, unmodified_lines_setting); end
1887
+
1888
+ # Returns a hook status/output tuple from the messages this processor was
1889
+ # initialized with.
1890
+ #
1891
+ # @return [Array<Symbol,String>]
1892
+ #
1893
+ # source://overcommit//lib/overcommit/message_processor.rb#30
1894
+ def hook_result(messages); end
1895
+
1896
+ private
1897
+
1898
+ # Returns status and output for messages assuming no special treatment of
1899
+ # messages occurring on unmodified lines.
1900
+ #
1901
+ # source://overcommit//lib/overcommit/message_processor.rb#101
1902
+ def basic_status_and_output(messages); end
1903
+
1904
+ # @return [Boolean]
1905
+ #
1906
+ # source://overcommit//lib/overcommit/message_processor.rb#95
1907
+ def can_upgrade_to_passing?(status, warning_messages); end
1908
+
1909
+ # @return [Boolean]
1910
+ #
1911
+ # source://overcommit//lib/overcommit/message_processor.rb#91
1912
+ def can_upgrade_to_warning?(status, error_messages); end
1913
+
1914
+ # source://overcommit//lib/overcommit/message_processor.rb#44
1915
+ def handle_modified_lines(messages, status); end
1916
+
1917
+ # @return [Boolean]
1918
+ #
1919
+ # source://overcommit//lib/overcommit/message_processor.rb#141
1920
+ def message_on_modified_line?(message); end
1921
+
1922
+ # source://overcommit//lib/overcommit/message_processor.rb#119
1923
+ def print_messages(messages, error_heading, warning_heading); end
1924
+
1925
+ # source://overcommit//lib/overcommit/message_processor.rb#134
1926
+ def remove_ignored_messages(messages); end
1927
+
1928
+ # source://overcommit//lib/overcommit/message_processor.rb#73
1929
+ def transform_status(status, messages_on_modified_lines); end
1930
+ end
1931
+
1932
+ # source://overcommit//lib/overcommit/message_processor.rb#15
1933
+ Overcommit::MessageProcessor::ERRORS_GENERIC_HEADER = T.let(T.unsafe(nil), String)
1934
+
1935
+ # source://overcommit//lib/overcommit/message_processor.rb#11
1936
+ Overcommit::MessageProcessor::ERRORS_MODIFIED_HEADER = T.let(T.unsafe(nil), String)
1937
+
1938
+ # source://overcommit//lib/overcommit/message_processor.rb#13
1939
+ Overcommit::MessageProcessor::ERRORS_UNMODIFIED_HEADER = T.let(T.unsafe(nil), String)
1940
+
1941
+ # source://overcommit//lib/overcommit/message_processor.rb#16
1942
+ Overcommit::MessageProcessor::WARNINGS_GENERIC_HEADER = T.let(T.unsafe(nil), String)
1943
+
1944
+ # source://overcommit//lib/overcommit/message_processor.rb#12
1945
+ Overcommit::MessageProcessor::WARNINGS_MODIFIED_HEADER = T.let(T.unsafe(nil), String)
1946
+
1947
+ # source://overcommit//lib/overcommit/message_processor.rb#14
1948
+ Overcommit::MessageProcessor::WARNINGS_UNMODIFIED_HEADER = T.let(T.unsafe(nil), String)
1949
+
1950
+ # Methods relating to the current operating system
1951
+ #
1952
+ # source://overcommit//lib/overcommit/os.rb#7
1953
+ module Overcommit::OS
1954
+ class << self
1955
+ # @return [Boolean]
1956
+ #
1957
+ # source://overcommit//lib/overcommit/os.rb#13
1958
+ def cygwin?; end
1959
+
1960
+ # @return [Boolean]
1961
+ #
1962
+ # source://overcommit//lib/overcommit/os.rb#25
1963
+ def linux?; end
1964
+
1965
+ # @return [Boolean]
1966
+ #
1967
+ # source://overcommit//lib/overcommit/os.rb#17
1968
+ def mac?; end
1969
+
1970
+ # @return [Boolean]
1971
+ #
1972
+ # source://overcommit//lib/overcommit/os.rb#21
1973
+ def unix?; end
1974
+
1975
+ # @return [Boolean]
1976
+ #
1977
+ # source://overcommit//lib/overcommit/os.rb#9
1978
+ def windows?; end
1979
+
1980
+ private
1981
+
1982
+ # source://overcommit//lib/overcommit/os.rb#31
1983
+ def host_os; end
1984
+ end
1985
+ end
1986
+
1987
+ # source://overcommit//lib/overcommit/os.rb#36
1988
+ Overcommit::OS::SEPARATOR = T.let(T.unsafe(nil), String)
1989
+
1990
+ # Provide a set of callbacks which can be executed as events occur during the
1991
+ # course of {HookRunner#run}.
1992
+ #
1993
+ # source://overcommit//lib/overcommit/printer.rb#8
1994
+ class Overcommit::Printer
1995
+ # @return [Printer] a new instance of Printer
1996
+ #
1997
+ # source://overcommit//lib/overcommit/printer.rb#11
1998
+ def initialize(config, logger, context); end
1999
+
2000
+ # Executed at the end of an individual hook run.
2001
+ #
2002
+ # source://overcommit//lib/overcommit/printer.rb#37
2003
+ def end_hook(hook, status, output); end
2004
+
2005
+ # source://overcommit//lib/overcommit/printer.rb#79
2006
+ def hook_run_failed(message); end
2007
+
2008
+ # source://overcommit//lib/overcommit/printer.rb#28
2009
+ def hook_skipped(hook); end
2010
+
2011
+ # source://overcommit//lib/overcommit/printer.rb#45
2012
+ def interrupt_triggered; end
2013
+
2014
+ # Returns the value of attribute log.
2015
+ #
2016
+ # source://overcommit//lib/overcommit/printer.rb#9
2017
+ def log; end
2018
+
2019
+ # source://overcommit//lib/overcommit/printer.rb#24
2020
+ def nothing_to_run; end
2021
+
2022
+ # source://overcommit//lib/overcommit/printer.rb#32
2023
+ def required_hook_not_skipped(hook); end
2024
+
2025
+ # Executed when one or more hooks by the end of the run.
2026
+ #
2027
+ # source://overcommit//lib/overcommit/printer.rb#57
2028
+ def run_failed; end
2029
+
2030
+ # Executed when a hook run was interrupted/cancelled by user.
2031
+ #
2032
+ # source://overcommit//lib/overcommit/printer.rb#50
2033
+ def run_interrupted; end
2034
+
2035
+ # Executed when no hooks failed by the end of the run.
2036
+ #
2037
+ # source://overcommit//lib/overcommit/printer.rb#71
2038
+ def run_succeeded; end
2039
+
2040
+ # Executed when no hooks failed by the end of the run, but some warned.
2041
+ #
2042
+ # source://overcommit//lib/overcommit/printer.rb#64
2043
+ def run_warned; end
2044
+
2045
+ # Executed at the very beginning of running the collection of hooks.
2046
+ #
2047
+ # source://overcommit//lib/overcommit/printer.rb#20
2048
+ def start_run; end
2049
+
2050
+ private
2051
+
2052
+ # source://overcommit//lib/overcommit/printer.rb#119
2053
+ def hook_script_name; end
2054
+
2055
+ # source://overcommit//lib/overcommit/printer.rb#87
2056
+ def print_header(hook); end
2057
+
2058
+ # source://overcommit//lib/overcommit/printer.rb#115
2059
+ def print_report(output, format = T.unsafe(nil)); end
2060
+
2061
+ # source://overcommit//lib/overcommit/printer.rb#95
2062
+ def print_result(hook, status, output); end
2063
+
2064
+ # Get all public methods that were defined on this class and wrap them with
2065
+ # synchronization locks so we ensure the output isn't interleaved amongst
2066
+ # the various threads.
2067
+ #
2068
+ # source://overcommit//lib/overcommit/printer.rb#126
2069
+ def synchronize_all_methods; end
2070
+ end
2071
+
2072
+ # source://overcommit//lib/overcommit/constants.rb#11
2073
+ Overcommit::REPO_URL = T.let(T.unsafe(nil), String)
2074
+
2075
+ # Manages execution of a child process, collecting the exit status and
2076
+ # standard out/error output.
2077
+ #
2078
+ # source://overcommit//lib/overcommit/subprocess.rb#10
2079
+ class Overcommit::Subprocess
2080
+ class << self
2081
+ # Spawns a new process using the given array of arguments (the first
2082
+ # element is the command).
2083
+ #
2084
+ # @option options
2085
+ # @param args [Array<String>]
2086
+ # @param options [Hash]
2087
+ # @return [Result]
2088
+ #
2089
+ # source://overcommit//lib/overcommit/subprocess.rb#30
2090
+ def spawn(args, options = T.unsafe(nil)); end
2091
+
2092
+ # Spawns a new process in the background using the given array of
2093
+ # arguments (the first element is the command).
2094
+ #
2095
+ # source://overcommit//lib/overcommit/subprocess.rb#60
2096
+ def spawn_detached(args); end
2097
+
2098
+ private
2099
+
2100
+ # @param process [ChildProcess]
2101
+ # @return [Array<IO>]
2102
+ #
2103
+ # source://overcommit//lib/overcommit/subprocess.rb#89
2104
+ def assign_output_streams(process); end
2105
+
2106
+ # Necessary to run commands in the cmd.exe context.
2107
+ # Args are joined to properly handle quotes and special characters.
2108
+ #
2109
+ # source://overcommit//lib/overcommit/subprocess.rb#75
2110
+ def win32_prepare_args(args); end
2111
+ end
2112
+ end
2113
+
2114
+ # Encapsulates the result of a process.
2115
+ #
2116
+ # @attr_reader status [Integer] exit status code returned by process
2117
+ # @attr_reader stdout [String] standard output stream output
2118
+ # @attr_reader stderr [String] standard error stream output
2119
+ #
2120
+ # source://overcommit//lib/overcommit/subprocess.rb#16
2121
+ class Overcommit::Subprocess::Result < ::Struct
2122
+ # exit status code returned by process
2123
+ #
2124
+ # @return [Integer] the current value of status
2125
+ def status; end
2126
+
2127
+ def status=(_); end
2128
+
2129
+ # standard error stream output
2130
+ #
2131
+ # @return [String] the current value of stderr
2132
+ def stderr; end
2133
+
2134
+ def stderr=(_); end
2135
+
2136
+ # standard output stream output
2137
+ #
2138
+ # @return [String] the current value of stdout
2139
+ def stdout; end
2140
+
2141
+ def stdout=(_); end
2142
+
2143
+ # @return [Boolean]
2144
+ #
2145
+ # source://overcommit//lib/overcommit/subprocess.rb#17
2146
+ def success?; end
2147
+
2148
+ class << self
2149
+ def [](*_arg0); end
2150
+ def inspect; end
2151
+ def keyword_init?; end
2152
+ def members; end
2153
+ def new(*_arg0); end
2154
+ end
2155
+ end
2156
+
2157
+ # Utility functions for general use.
2158
+ #
2159
+ # source://overcommit//lib/overcommit/utils/file_utils.rb#6
2160
+ module Overcommit::Utils
2161
+ class << self
2162
+ # Returns whether a file is a broken symlink.
2163
+ #
2164
+ # @return [true, false]
2165
+ #
2166
+ # source://overcommit//lib/overcommit/utils.rb#268
2167
+ def broken_symlink?(file); end
2168
+
2169
+ # Converts a string containing underscores/hyphens/spaces into CamelCase.
2170
+ #
2171
+ # source://overcommit//lib/overcommit/utils.rb#97
2172
+ def camel_case(str); end
2173
+
2174
+ # Convert a glob pattern to an absolute path glob pattern rooted from the
2175
+ # repository root directory.
2176
+ #
2177
+ # @param glob [String]
2178
+ # @return [String]
2179
+ #
2180
+ # source://overcommit//lib/overcommit/utils.rb#279
2181
+ def convert_glob_to_absolute(glob); end
2182
+
2183
+ # Execute a command in a subprocess, capturing exit status and output from
2184
+ # both standard and error streams.
2185
+ #
2186
+ # This is intended to provide a centralized place to perform any checks or
2187
+ # filtering of the command before executing it.
2188
+ #
2189
+ # The `args` option provides a convenient way of splitting up long
2190
+ # argument lists which would otherwise exceed the maximum command line
2191
+ # length of the OS. It will break up the list into chunks and run the
2192
+ # command with the same prefix `initial_args`, finally combining the
2193
+ # output together at the end.
2194
+ #
2195
+ # This requires that the external command you are running can have its
2196
+ # work split up in this way and still produce the same resultant output
2197
+ # when outputs of the individual commands are concatenated back together.
2198
+ #
2199
+ # @option options
2200
+ # @param initial_args [Array<String>]
2201
+ # @param options [Hash]
2202
+ # @return [Overcommit::Subprocess::Result] status, stdout, and stderr
2203
+ #
2204
+ # source://overcommit//lib/overcommit/utils.rb#175
2205
+ def execute(initial_args, options = T.unsafe(nil)); end
2206
+
2207
+ # Execute a command in a subprocess, returning immediately.
2208
+ #
2209
+ # This provides a convenient way to execute long-running processes for
2210
+ # which we do not need to know the result.
2211
+ #
2212
+ # @param args [Array<String>]
2213
+ # @return [ChildProcess] detached process spawned in the background
2214
+ #
2215
+ # source://overcommit//lib/overcommit/utils.rb#204
2216
+ def execute_in_background(args); end
2217
+
2218
+ # Returns an absolute path to the .git directory for a repo.
2219
+ #
2220
+ # @return [String]
2221
+ #
2222
+ # source://overcommit//lib/overcommit/utils.rb#61
2223
+ def git_dir; end
2224
+
2225
+ # @param cmd [String]
2226
+ # @return [true, false] whether a command can be found given the current
2227
+ # environment path.
2228
+ #
2229
+ # source://overcommit//lib/overcommit/utils.rb#119
2230
+ def in_path?(cmd); end
2231
+
2232
+ # @return [Overcommit::Logger] logger with which to send debug output
2233
+ #
2234
+ # source://overcommit//lib/overcommit/utils.rb#32
2235
+ def log; end
2236
+
2237
+ # @return [Overcommit::Logger] logger with which to send debug output
2238
+ #
2239
+ # source://overcommit//lib/overcommit/utils.rb#32
2240
+ def log=(_arg0); end
2241
+
2242
+ # Return whether a pattern matches the given path.
2243
+ #
2244
+ # @param pattern [String]
2245
+ # @param path [String]
2246
+ # @return [Boolean]
2247
+ #
2248
+ # source://overcommit//lib/overcommit/utils.rb#287
2249
+ def matches_path?(pattern, path); end
2250
+
2251
+ # Return the parent command that triggered this hook run
2252
+ #
2253
+ # @return [String, nil] the command as a string, if a parent exists.
2254
+ #
2255
+ # source://overcommit//lib/overcommit/utils.rb#138
2256
+ def parent_command; end
2257
+
2258
+ # Return the number of processors used by the OS for process scheduling.
2259
+ #
2260
+ # @see https://github.com/grosser/parallel/blob/v1.6.1/lib/parallel/processor_count.rb#L17-L51
2261
+ #
2262
+ # source://overcommit//lib/overcommit/utils.rb#217
2263
+ def processor_count; end
2264
+
2265
+ # Returns an absolute path to the root of the repository.
2266
+ #
2267
+ # We do this ourselves rather than call `git rev-parse --show-toplevel` to
2268
+ # solve an issue where the .git directory might not actually be valid in
2269
+ # tests.
2270
+ #
2271
+ # @return [String]
2272
+ #
2273
+ # source://overcommit//lib/overcommit/utils.rb#45
2274
+ def repo_root; end
2275
+
2276
+ # source://overcommit//lib/overcommit/utils.rb#34
2277
+ def script_path(script); end
2278
+
2279
+ # Shamelessly stolen from:
2280
+ # stackoverflow.com/questions/1509915/converting-camel-case-to-underscore-case-in-ruby
2281
+ #
2282
+ # source://overcommit//lib/overcommit/utils.rb#88
2283
+ def snake_case(str); end
2284
+
2285
+ # Remove ANSI escape sequences from a string.
2286
+ #
2287
+ # This is useful for stripping colorized output from external tools.
2288
+ #
2289
+ # @param text [String]
2290
+ # @return [String]
2291
+ #
2292
+ # source://overcommit//lib/overcommit/utils.rb#82
2293
+ def strip_color_codes(text); end
2294
+
2295
+ # Returns a list of supported hook classes (PreCommit, CommitMsg, etc.)
2296
+ #
2297
+ # source://overcommit//lib/overcommit/utils.rb#110
2298
+ def supported_hook_type_classes; end
2299
+
2300
+ # Returns a list of supported hook types (pre-commit, commit-msg, etc.)
2301
+ #
2302
+ # source://overcommit//lib/overcommit/utils.rb#102
2303
+ def supported_hook_types; end
2304
+
2305
+ # Calls a block of code with a modified set of environment variables,
2306
+ # restoring them once the code has executed.
2307
+ #
2308
+ # source://overcommit//lib/overcommit/utils.rb#253
2309
+ def with_environment(env); end
2310
+
2311
+ private
2312
+
2313
+ # Log debug output.
2314
+ #
2315
+ # This is necessary since some specs indirectly call utility functions but
2316
+ # don't explicitly set the logger for the Utils class, so we do a quick
2317
+ # check here to see if it's set before we attempt to log.
2318
+ #
2319
+ # @param args [Array<String>]
2320
+ #
2321
+ # source://overcommit//lib/overcommit/utils.rb#304
2322
+ def debug(*args); end
2323
+ end
2324
+ end
2325
+
2326
+ # Utility functions for file IO.
2327
+ #
2328
+ # source://overcommit//lib/overcommit/utils/file_utils.rb#8
2329
+ module Overcommit::Utils::FileUtils
2330
+ class << self
2331
+ # When the host OS is Windows, uses the `dir` command to check whether
2332
+ # `link_name` is an NTFS symbolic link. If so, it parses the target from
2333
+ # the command output. Otherwise raises an `ArgumentError`. Delegates to
2334
+ # `File.readlink` if the host OS is not Windows.
2335
+ #
2336
+ # source://overcommit//lib/overcommit/utils/file_utils.rb#34
2337
+ def readlink(link_name); end
2338
+
2339
+ # When the host OS is Windows, uses the `mklink` command to create an
2340
+ # NTFS symbolic link from `new_name` to `old_name`. Otherwise delegates
2341
+ # to `File.symlink`
2342
+ #
2343
+ # source://overcommit//lib/overcommit/utils/file_utils.rb#13
2344
+ def symlink(old_name, new_name); end
2345
+
2346
+ # When the host OS is Windows, uses the `dir` command to check whether
2347
+ # `file_name` is an NTFS symbolic link. Otherwise delegates to
2348
+ # `File.symlink`.
2349
+ #
2350
+ # @return [Boolean]
2351
+ #
2352
+ # source://overcommit//lib/overcommit/utils/file_utils.rb#23
2353
+ def symlink?(file_name); end
2354
+
2355
+ private
2356
+
2357
+ # source://overcommit//lib/overcommit/utils/file_utils.rb#50
2358
+ def win32_dir_cmd(file_name); end
2359
+
2360
+ # source://overcommit//lib/overcommit/utils/file_utils.rb#62
2361
+ def win32_fix_pathsep(path); end
2362
+
2363
+ # source://overcommit//lib/overcommit/utils/file_utils.rb#56
2364
+ def win32_mklink_cmd(old_name, new_name); end
2365
+
2366
+ # @return [Boolean]
2367
+ #
2368
+ # source://overcommit//lib/overcommit/utils/file_utils.rb#66
2369
+ def win32_symlink?(dir_output); end
2370
+ end
2371
+ end
2372
+
2373
+ # Helper class for doing quick constraint validations on version numbers.
2374
+ #
2375
+ # This allows us to execute code based on the git version.
2376
+ #
2377
+ # source://overcommit//lib/overcommit/utils.rb#15
2378
+ class Overcommit::Utils::Version < ::Gem::Version
2379
+ # source://overcommit//lib/overcommit/utils.rb#19
2380
+ def !=(version); end
2381
+
2382
+ # source://overcommit//lib/overcommit/utils.rb#19
2383
+ def <(version); end
2384
+
2385
+ # source://overcommit//lib/overcommit/utils.rb#19
2386
+ def <=(version); end
2387
+
2388
+ # source://overcommit//lib/overcommit/utils.rb#19
2389
+ def ==(version); end
2390
+
2391
+ # source://overcommit//lib/overcommit/utils.rb#19
2392
+ def >(version); end
2393
+
2394
+ # source://overcommit//lib/overcommit/utils.rb#19
2395
+ def >=(version); end
2396
+ end
2397
+
2398
+ # source://overcommit//lib/overcommit/version.rb#5
2399
+ Overcommit::VERSION = T.let(T.unsafe(nil), String)