<commit_before>from __future__ import absolute_import
from __future__ import print_function

import os
import re

from sys import version_info

import sublime

IS_PY2 = version_info[0] == 2
IS_ST3 = int(sublime.version()) >= 3000

PLUGIN_NAME = 'JsPrettier'
PLUGIN_CMD_NAME = 'js_prettier'
PROJECT_SETTINGS_KEY = PLUGIN_CMD_NAME
SETTINGS_FILENAME = '{0}.sublime-settings'.format(PLUGIN_NAME)
PRETTIER_OPTIONS_KEY = 'prettier_options'

PLUGIN_PATH = os.path.join(sublime.packages_path(), os.path.dirname(os.path.realpath(__file__)))

SYNTAX_ERROR_RE = re.compile(
    r'^.+?:\s(?:(?P<error>SyntaxError)):\s(?P<message>.+) \((?P<line>\d+):(?P<col>\d+)\)',
    re.MULTILINE
)

# ref: https://prettier.io/docs/en/configuration.html
PRETTIER_CONFIG_FILES = [
    '.prettierrc',
    '.prettierrc.json',
    '.prettierrc.js',
    'prettier.config.js',
    'package.json',
    '.prettierrc.yml',
    '.prettierrc.yaml',
    '.prettierrc.toml'
]

PRETTIER_IGNORE_FILE = '.prettierignore'

PRETTIER_OPTION_CLI_MAP = [
    {
        'option': 'printWidth',
        'cli': '--print-width',
        'default': '80'
    },
    {
        'option': 'tabWidth',
        'cli': '--tab-width',
        'default': '2'
    },
    {
        'option': 'singleQuote',
        'cli': '--single-quote',
        'default': 'false'
    },
    {
        'option': 'trailingComma',
        'cli': '--trailing-comma',
        'default': 'es5'
    },
    {
        'option': 'bracketSpacing',<commit_msg>Try/detect more prettier config files<commit_after>from __future__ import absolute_import
from __future__ import print_function

import os
import re

from sys import version_info

import sublime

IS_PY2 = version_info[0] == 2
IS_ST3 = int(sublime.version()) >= 3000

PLUGIN_NAME = 'JsPrettier'
PLUGIN_CMD_NAME = 'js_prettier'
PROJECT_SETTINGS_KEY = PLUGIN_CMD_NAME
SETTINGS_FILENAME = '{0}.sublime-settings'.format(PLUGIN_NAME)
PRETTIER_OPTIONS_KEY = 'prettier_options'

PLUGIN_PATH = os.path.join(sublime.packages_path(), os.path.dirname(os.path.realpath(__file__)))

SYNTAX_ERROR_RE = re.compile(
    r'^.+?:\s(?:(?P<error>SyntaxError)):\s(?P<message>.+) \((?P<line>\d+):(?P<col>\d+)\)',
    re.MULTILINE
)

# ref: https://prettier.io/docs/en/configuration.html
PRETTIER_CONFIG_FILES = [
    '.prettierrc',
    'package.json',
    '.prettierrc.json',
    '.prettierrc.js',
    '.prettierrc.yaml',
    '.prettierrc.yml',
    '.prettierrc.toml',
    '.prettierrc.cjs',
    'prettier.config.cjs',
    'prettier.config.js',
    '.prettierrc.json5'
]

PRETTIER_IGNORE_FILE = '.prettierignore'

PRETTIER_OPTION_CLI_MAP = [
    {
        'option': 'printWidth',
        'cli': '--print-width',
        'default': '80'
    },
    {
        'option': 'tabWidth',
        'cli': '--tab-width',
        'default': '2'
    },
    {
        'option': 'singleQuote',
        'cli': '--single-quote',
        'default': 'false'
    },
    {
        'option': 'trailingComma',
        'cli': '--trailing-comma',
        'default': 'es5'
    },
    {
        'option': 'bracketSpacing',
{'fraction_non_alphanumeric': 0.17548471902727572, 'fraction_numerical': 0.008872822872165627, 'mean_word_length': 3.141496598639456, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '4397429', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1173, 'n_words': 170}