docs: async function runGitHook(config, hookType) {
      if (!(config instanceof Object)) {
          throw new TypeError("Value of argument \"config\" violates contract.\n\nExpected:\nObject\n\nGot:\n" + _inspect(config));
      }
  
      if (!hookName(hookType)) {
          throw new TypeError("Value of argument \"hookType\" violates contract.\n\nExpected:\nhookName\n\nGot:\n" + _inspect(hookType));
      }
  
      let err;
      let output;
  
      // Pre-commit hook handler
      // Note: it may be that the only thing which changes for non pre-commit usage is the cmd to run to get the files
      // Note: It might be worth splitting this out into another function if we add other handlers
      if (hookType === "pre-commit") {
          try {
              const rawFilesList = await exec(config.gitStatusCmd, config.execOptions);
  
              if (rawFilesList.stderr != "") {
                  err = rawFilesList.stderr;
              } else if (rawFilesList.stdout != "") {
                  const filteredFiles = await filterFilesList(rawFilesList.stdout, config.ignoreGitStatusResultPrefixes, _os.EOL);
  
                  if (filteredFiles.size > 0) {
                      const violations = await scanFilteredFiles(filteredFiles, config.fileContentRegexps, config.violatingFilenameExtensions, config.filesToIgnore);
  
                      if (violations) {
                          output = await formatOutput(config.violationsMessageHeader, violations, config.violationsMessageFooter);
                      }
                  }
              }
          } catch (e) {
              err = e;
          }
      }
  
      const p = new Promise((resolve, reject) => {
          // We only reject the promise if there is an actual error...
          // ...we don't reject on finding violating files, that will be handled in the pre-commit script
          if (err) {
              reject(err);
          } else {
              resolve(output);
          }
      });
  
      return p;
  }