<commit_before>'use strict'

var exec = require('mz/child_process').exec
var path = require('path')
var router = require('koa-router')
var parse = require('co-body')
var app = require('../app')

// router
app.use(router(app))
app.post('/pull-request', pullRequestServer)

app.get('/', test)

function* pullRequestServer() {
	var body = yield parse.json(this)
	var action = body.action
	var head = body.pull_request.head
	var base = body.pull_request.base
	var headRepo = {
		url: 'https://github.com/' + head.repo.full_name,
		origin: head.label.split(':').shift(),
		branch: head.ref,
		name: head.repo.name
	}
	var baseRepo = {
		url: 'https://github.com/' + base.repo.full_name,
		origin: base.label.split(':').shift(),
		branch: base.ref,
		name: head.repo.name
	}
	var params = [
		baseRepo.url,
		baseRepo.origin,
		baseRepo.branch,
		baseRepo.name,
		headRepo.url,
		headRepo.origin,
		headRepo.branch,
		headRepo.name
	].join(' ')
	if (action === 'opened') {

		// .editorconfig check<commit_msg>add synchronize event handle<commit_after>'use strict'

var exec = require('mz/child_process').exec
var path = require('path')
var router = require('koa-router')
var parse = require('co-body')
var app = require('../app')

// router
app.use(router(app))
app.post('/pull-request', pullRequestServer)

app.get('/', test)

function* pullRequestServer() {
	var body = yield parse.json(this)
	var action = body.action
	var head = body.pull_request.head
	var base = body.pull_request.base
	var headRepo = {
		url: 'https://github.com/' + head.repo.full_name,
		origin: head.label.split(':').shift(),
		branch: head.ref,
		name: head.repo.name
	}
	var baseRepo = {
		url: 'https://github.com/' + base.repo.full_name,
		origin: base.label.split(':').shift(),
		branch: base.ref,
		name: head.repo.name
	}
	var params = [
		baseRepo.url,
		baseRepo.origin,
		baseRepo.branch,
		baseRepo.name,
		headRepo.url,
		headRepo.origin,
		headRepo.branch,
		headRepo.name
	].join(' ')
	if (action === 'opened' || action === 'synchronize') {

		// .editorconfig check
{'fraction_non_alphanumeric': 0.17406143344709898, 'fraction_numerical': 0.0, 'mean_word_length': 3.862559241706161, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4113326', 'n_tokens_mistral': 767, 'n_tokens_neox': 748, 'n_words': 156}