<commit_before>/* @flow weak */

import { basename, dirname } from 'path'
import { matcher, makeRe } from 'micromatch'

export type IgnorePattern = {
  match: (string) => boolean,
  basename: boolean,
  folder: boolean,
  negate: boolean
}

// Cozy-desktop can ignore some files and folders from a list of patterns in the
// cozyignore file. This class can be used to know if a file/folder is ignored.
//
// See https://git-scm.com/docs/gitignore/#_pattern_format
let DefaultRules
let MicromatchOptions
class Ignore {
  static initClass () {
    // See https://github.com/github/gitignore/tree/master/Global
    DefaultRules = [
      // Dropbox
      '.dropbox',
      '.dropbox.attr',
      '.dropbox.cache',

      // Eclipse, SublimeText and many others
      '*.tmp',
      '*.bak',

      // Emacs
      '*~',
      '\\#*\\#',

      // LibreOffice
      '.~lock.*#',

      // Linux
      '.fuse_hidden*',
      '.Trash-*',

      // Microsoft Office
      '~$*.{doc,xls,ppt}*',

      // OSX
      '.DS_Store',
      '.DocumentRevisions-V100',
      '.fseventsd',
      '.Spotlight-V100',
      '.TemporaryItems',
      '.Trashes',
      '.VolumeIcon.icns',

      // Vim
      '*.sw[px]',<commit_msg>Don't synchronize ignore Icon^M files on macOS<commit_after>/* @flow weak */

import { basename, dirname } from 'path'
import { matcher, makeRe } from 'micromatch'

export type IgnorePattern = {
  match: (string) => boolean,
  basename: boolean,
  folder: boolean,
  negate: boolean
}

// Cozy-desktop can ignore some files and folders from a list of patterns in the
// cozyignore file. This class can be used to know if a file/folder is ignored.
//
// See https://git-scm.com/docs/gitignore/#_pattern_format
let DefaultRules
let MicromatchOptions
class Ignore {
  static initClass () {
    // See https://github.com/github/gitignore/tree/master/Global
    DefaultRules = [
      // Dropbox
      '.dropbox',
      '.dropbox.attr',
      '.dropbox.cache',

      // Eclipse, SublimeText and many others
      '*.tmp',
      '*.bak',

      // Emacs
      '*~',
      '\\#*\\#',

      // LibreOffice
      '.~lock.*#',

      // Linux
      '.fuse_hidden*',
      '.Trash-*',

      // Microsoft Office
      '~$*.{doc,xls,ppt}*',

      // OSX
      '.DS_Store',
      '.DocumentRevisions-V100',
      '.fseventsd',
      '.Spotlight-V100',
      '.TemporaryItems',
      '.Trashes',
      '.VolumeIcon.icns',
      'Icon\r',

      // Vim
      '*.sw[px]',
{'fraction_non_alphanumeric': 0.16051884880421566, 'fraction_numerical': 0.004864207539521687, 'mean_word_length': 2.112232030264817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '2081585', 'n_tokens_mistral': 850, 'n_tokens_neox': 808, 'n_words': 198}