<commit_before>﻿// MySync © 2016-2017 Damian 'Erdroy' Korczowski

namespace MySync.Shared.Utilities
{
    /// <summary>
    /// File utils class.
    /// </summary>
    public static class FileUtils
    {
        /// <summary>
        /// Checks if file is excluded using exclusion list.
        /// </summary>
        /// <param name="fileName">The file to check.</param>
        /// <param name="exclusions">The exclusion list.</param>
        /// <returns>True when file is excluded.</returns>
        public static bool IsExcluded(string fileName, string[] exclusions)
        {
            fileName = fileName.Replace("\\", "/");

            foreach (var exclude in exclusions)
            {
                if (exclude.Length < 2) // validate
                    continue;

                // check directory exclude
                if ((exclude.EndsWith("/") || exclude.EndsWith("*")) && fileName.StartsWith(exclude.Replace("*", "")))
                    return true;
<commit_msg>allow to make project without .ignores file<commit_after>﻿// MySync © 2016-2017 Damian 'Erdroy' Korczowski

namespace MySync.Shared.Utilities
{
    /// <summary>
    /// File utils class.
    /// </summary>
    public static class FileUtils
    {
        /// <summary>
        /// Checks if file is excluded using exclusion list.
        /// </summary>
        /// <param name="fileName">The file to check.</param>
        /// <param name="exclusions">The exclusion list.</param>
        /// <returns>True when file is excluded.</returns>
        public static bool IsExcluded(string fileName, string[] exclusions)
        {
            fileName = fileName.Replace("\\", "/");

            if (exclusions == null || exclusions.Length == 0)
                return false;

            foreach (var exclude in exclusions)
            {
                if (exclude.Length < 2) // validate
                    continue;

                // check directory exclude
                if ((exclude.EndsWith("/") || exclude.EndsWith("*")) && fileName.StartsWith(exclude.Replace("*", "")))
                    return true;

{'fraction_non_alphanumeric': 0.13959028108623153, 'fraction_numerical': 0.009051929490233444, 'mean_word_length': 1.7486910994764397, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, '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': '3310733', 'n_tokens_mistral': 562, 'n_tokens_neox': 533, 'n_words': 153}