MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / _all_filenames

Function _all_filenames

pre_commit/commands/run.py:253–271  ·  view source on GitHub ↗
(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

251
252
253def _all_filenames(args: argparse.Namespace) -> Iterable[str]:
254 # these hooks do not operate on files
255 if args.hook_stage in {
256 'post-checkout', 'post-commit', 'post-merge', 'post-rewrite',
257 'pre-rebase',
258 }:
259 return ()
260 elif args.hook_stage in {'prepare-commit-msg', 'commit-msg'}:
261 return (args.commit_msg_filename,)
262 elif args.from_ref and args.to_ref:
263 return git.get_changed_files(args.from_ref, args.to_ref)
264 elif args.files:
265 return args.files
266 elif args.all_files:
267 return git.get_all_files()
268 elif git.is_in_merge_conflict():
269 return git.get_conflicted_files()
270 else:
271 return git.get_staged_files()
272
273
274def _get_diff() -> bytes:

Callers 1

_run_hooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected