<commit_before>package com.github.eirslett.maven.plugins.frontend;

import java.io.File;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

import static com.github.eirslett.maven.plugins.frontend.Utils.executeAndGetResult;
import static com.github.eirslett.maven.plugins.frontend.Utils.joinPath;

@Mojo(name="karma",  defaultPhase = LifecyclePhase.TEST)
public final class KarmaRunMojo extends AbstractMojo {

    @Parameter(defaultValue = "${basedir}", property = "workingDirectory", required = false)
    private File workingDirectory;

    /**
     * Path to your karma configuration file, relative to the working directory (defaults to "karma.conf.js")
     */
    @Parameter(defaultValue = "karma.conf.js")
    private String karmaConfPath;

    private final Log logger;

    public KarmaRunMojo() {
        logger = super.getLog();
    }

    KarmaRunMojo(File workingDirectory, String karmaConfPath, Log logger){
        this.workingDirectory = workingDirectory;
        this.karmaConfPath = karmaConfPath;
        this.logger = logger;
    }

    @Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        logger.info("Running karma in " + workingDirectory.toString());
        final String karmaPath = workingDirectory+"/node_modules/karma/bin/karma".replace("/", File.separator);
        int result = new NodeExecutor(workingDirectory, getLog()).execute(karmaPath, "start", workingDirectory+File.separator+karmaConfPath);
        if(result != 0){
            throw new MojoFailureException("Karma run failed.");
        }
    }
}
<commit_msg>Karma mojo honors -DskipTests<commit_after>package com.github.eirslett.maven.plugins.frontend;

import java.io.File;
import java.util.Map;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

import static com.github.eirslett.maven.plugins.frontend.Utils.executeAndGetResult;
import static com.github.eirslett.maven.plugins.frontend.Utils.joinPath;

@Mojo(name="karma",  defaultPhase = LifecyclePhase.TEST)
public final class KarmaRunMojo extends AbstractMojo {

    @Parameter(defaultValue = "${basedir}", property = "workingDirectory", required = false)
    private File workingDirectory;

    /**
     * Path to your karma configuration file, relative to the working directory (defaults to "karma.conf.js")
     */
    @Parameter(defaultValue = "karma.conf.js")
    private String karmaConfPath;

    @Parameter(property = "skipTests", required = false, defaultValue = "false")
    private Boolean skipTests;

    private final Log logger;

    public KarmaRunMojo() {
        logger = super.getLog();
    }

    KarmaRunMojo(File workingDirectory, String karmaConfPath, Log logger){
        this.workingDirectory = workingDirectory;
        this.karmaConfPath = karmaConfPath;
        this.logger = logger;
    }

    @Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        if(skipTests){
            logger.info("Skipping karma tests.");
        } else {
            logger.info("Running karma in " + workingDirectory.toString());
            final String karmaPath = workingDirectory+"/node_modules/karma/bin/karma".replace("/", File.separator);
            int result = new NodeExecutor(workingDirectory, getLog()).execute(karmaPath, "start", workingDirectory+File.separator+karmaConfPath);
            if(result != 0){
                throw new MojoFailureException("Karma run failed.");
            }
        }
    }
}

{'fraction_non_alphanumeric': 0.1066797161732322, 'fraction_numerical': 0.0004893564962074871, 'mean_word_length': 3.8782816229116945, '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': '5941074', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1130, 'n_words': 241}