def pre_commit(self, git_diff_index):
        # Grab this plugin's settings
        data_in = {
            'config': self.config,
            'files': git_diff_index}

        script = join(self.path, PLUGIN_PRE_COMMIT_SCRIPT)
        ph = Popen([script], stdin=PIPE, stdout=PIPE, stderr=PIPE)

        # Send the data to the script
        stdin = json.dumps(data_in, indent=2, cls=PluginDataJSONEncoder)

        retcode = None
        stdout = ''
        stderr = ''

        try:
            stdout, stderr = ph.communicate(stdin)

            # Convert to unicode
            stdout = stdout.decode('utf-8')
            stderr = stderr.decode('utf-8')

            retcode = ph.returncode
        except OSError as ose:
            # Generic non-zero retcode that indicates an error
            retcode = 1
            if ose.errno == 32:
                stderr = u'Error: received SIGPIPE from the command'
            else:
                stderr = unicode(ose)

        # And return the relevant stuff
        return retcode, stdout, stderr
Runs the plugin's pre-commit script, passing in the diff.
dataset/ETHPy150Open robmadole/jig/src/jig/plugins/manager.py/Plugin.pre_commit