mootool 0.1.2 → 0.2.2

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