<commit_before>import ISettingsParser from "./ISettingsParser";
import DefaultSettings from "./DefaultSettings";
import * as _ from "lodash";
import * as path from "path";

class SmildSettingsParser implements ISettingsParser {

    parse(): any {
        let smildFile = null,
            packageJson = {};
        try {
            packageJson = require(path.join(process.cwd(), 'package.json'));
        } catch (error) {
        }
        try {
            smildFile = require(path.join(process.cwd(), 'smildfile.js'));
        } catch (error) {
            smildFile = {};
        }
        return _.assign(DefaultSettings, smildFile, {
            projectPackage: packageJson
        });<commit_msg>Optional smildfile.js, "smild" in package.json <commit_after>import ISettingsParser from "./ISettingsParser";
import DefaultSettings from "./DefaultSettings";
import * as _ from "lodash";
import * as path from "path";

class SmildSettingsParser implements ISettingsParser {

    parse(): any {
        let smildFile = null,
            packageJson = {};
        try {
            packageJson = require(path.join(process.cwd(), 'package.json'));
        } catch (error) {
        }
        try {
            smildFile = require(path.join(process.cwd(), 'smildfile.js'));
        } catch (error) {
            smildFile = packageJson.smild ? packageJson.smild : {};
        }
        return _.assign(DefaultSettings, smildFile, {
            projectPackage: packageJson
        });
{'fraction_non_alphanumeric': 0.12061994609164421, 'fraction_numerical': 0.0, 'mean_word_length': 2.3445945945945947, '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': '3500483', 'n_tokens_mistral': 401, 'n_tokens_neox': 396, 'n_words': 97}