<commit_before>import lintreview.github as github
import lintreview.git as git
import lintreview.tools as tools
import logging

from celery import Celery
from lintreview.config import load_config
from lintreview.config import ReviewConfig
from lintreview.diff import DiffCollection
from lintreview.review import Review
from lintreview.review import Problems
from lintreview.processor import Processor

config = load_config()
celery = Celery('lintreview.tasks')
log = logging.getLogger(__name__)


@celery.task(ignore_result=True)
def process_pull_request(user, repo, number, lintrc):
    """
    Starts processing a pull request and running the various
    lint tools against it.
    """
    log.info('Starting to process lint for %s, %s, %s', user, repo, number)
    log.debug("lintrc contents '%s'", lintrc)
    review_config = ReviewConfig(lintrc)

    if len(review_config.linters()) == 0:
        log.info('No configured linters, skipping processing.')
        return

    gh = github.get_client(config, user, repo)
    try:
        log.info('Loading pull request data from github.')<commit_msg>Celery should use configuration file.<commit_after>import lintreview.github as github
import lintreview.git as git
import logging

from celery import Celery
from lintreview.config import load_config
from lintreview.config import ReviewConfig
from lintreview.processor import Processor

config = load_config()
celery = Celery('lintreview.tasks')
celery.config_from_object(config)

log = logging.getLogger(__name__)


@celery.task(ignore_result=True)
def process_pull_request(user, repo, number, lintrc):
    """
    Starts processing a pull request and running the various
    lint tools against it.
    """
    log.info('Starting to process lint for %s, %s, %s', user, repo, number)
    log.debug("lintrc contents '%s'", lintrc)
    review_config = ReviewConfig(lintrc)

    if len(review_config.linters()) == 0:
        log.info('No configured linters, skipping processing.')
        return

    gh = github.get_client(config, user, repo)
    try:
        log.info('Loading pull request data from github.')
{'fraction_non_alphanumeric': 0.09112482202183199, 'fraction_numerical': 0.0009492168960607499, 'mean_word_length': 4.363867684478372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '1027074', 'n_tokens_mistral': 637, 'n_tokens_neox': 607, 'n_words': 196}