<commit_before>package org.shipkit.internal.gradle.git;

import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
import org.shipkit.gradle.configuration.ShipkitConfiguration;
import org.shipkit.internal.gradle.configuration.ShipkitConfigurationPlugin;

import java.text.MessageFormat;

/**
 * Configures extension GitAuth that contains GitHub authentication info.
 * Applies plugins:
 * <ul>
 *     <li>{@link ShipkitConfigurationPlugin}</li>
 * </ul>
 */
public class GitAuthPlugin implements Plugin<Project> {

    private static final Logger LOG = Logging.getLogger(GitAuthPlugin.class);

    private GitAuth gitAuth;

    @Override
    public void apply(Project project) {
        ShipkitConfiguration conf = project.getPlugins().apply(ShipkitConfigurationPlugin.class).getConfiguration();
        String ghUser = conf.getGitHub().getWriteAuthUser();
        String writeToken = conf.getLenient().getGitHub().getWriteAuthToken();

        String configUrl = getGitHubUrl(ghUser, conf.getGitHub().getRepository(), writeToken);
        String secretValue = null;
        if (writeToken != null) {
            LOG.lifecycle("  'git push/pull' use GitHub write token.");
            secretValue = writeToken;
        } else {
            LOG.lifecycle("  'git push/pull' do not use GitHub write token because it was not specified.");<commit_msg>Added a TODO and updated Javadoc<commit_after>package org.shipkit.internal.gradle.git;

import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
import org.shipkit.gradle.configuration.ShipkitConfiguration;
import org.shipkit.internal.gradle.configuration.ShipkitConfigurationPlugin;

import java.text.MessageFormat;

/**
 * This plugin is used for internal purposes, it does not add any user-visible, public behavior.
 * It identifies GitHub repository url and keeps it in the field on this plugin.
 * Applies plugins:
 * <ul>
 *     <li>{@link ShipkitConfigurationPlugin}</li>
 * </ul>
 */
public class GitAuthPlugin implements Plugin<Project> {

    private static final Logger LOG = Logging.getLogger(GitAuthPlugin.class);

    private GitAuth gitAuth;

    @Override
    public void apply(Project project) {
        ShipkitConfiguration conf = project.getPlugins().apply(ShipkitConfigurationPlugin.class).getConfiguration();
        String ghUser = conf.getGitHub().getWriteAuthUser();
        String writeToken = conf.getLenient().getGitHub().getWriteAuthToken();

        String configUrl = getGitHubUrl(ghUser, conf.getGitHub().getRepository(), writeToken);
        String secretValue = null;
        //TODO we can push the lifecycle messages to the task execution (doFirst) and replace this plugin with simple convenience function
        if (writeToken != null) {
            LOG.lifecycle("  'git push/pull' use GitHub write token.");
            secretValue = writeToken;
        } else {
            LOG.lifecycle("  'git push/pull' do not use GitHub write token because it was not specified.");
{'fraction_non_alphanumeric': 0.10109114249037227, 'fraction_numerical': 0.0, 'mean_word_length': 3.832558139534884, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '1890429', 'n_tokens_mistral': 858, 'n_tokens_neox': 823, 'n_words': 231}