<commit_before>'use babel'

let Disposable = null
let CompositeDisposable = null
let ClangTidyCommand = null
let ClangTidy = null
let ClangArguments = null
let ClangTidyLinter = null
let ClangTidyAutocompleteProvider = null
let ClangRenameCommand
let ClangRenameView = null

function initialize () {
  if (!Disposable || !CompositeDisposable) {
    const atom = require('atom')
    Disposable = atom.Disposable
    CompositeDisposable = atom.CompositeDisposable
  }
  if (!ClangTidyCommand) ClangTidyCommand = require('./clang-tidy-command')
  if (!ClangTidy) ClangTidy = require('./clang-tidy')
  if (!ClangArguments) ClangArguments = require('./clang-arguments')
  if (!ClangTidyLinter) ClangTidyLinter = require('./clang-tidy-linter')
  if (!ClangTidyAutocompleteProvider) {
    ClangTidyAutocompleteProvider = require('./clang-tidy-autocomplete-provider')
  }
  if (!ClangRenameCommand) ClangRenameCommand = require('./clang-rename-command')
  if (!ClangRenameView) ClangRenameView = require('./clang-rename-view')
}

export default {
  subscriptions: null,

  grammars: [
    'source.c',
    'source.cpp',
    'source.objc',
    'source.objcpp'
  ],

  config: {
    clangTidyCommand: {
      title: 'clang-tidy command',
      type: 'string',
      default: 'clang-tidy'
    },
    clangRenameCommand: {
      title: 'clang-rename command',
      type: 'string',
      default: 'clang-rename'
    },
    clangCppFlags: {
      title: 'clang flags for C++',
      type: [],
      items: { type: 'string' }
    },
    clangCFlags: {
      title: 'clang flags for C',
      type: 'array',
      default: [],
      items: { type: 'string' }
    },
    clangObjectiveCppFlags: {
      title: 'clang flags for Objective C++',
      type: 'array',
      default: [],
      items: { type: 'string' }
    },
    clangObjectiveCFlags: {
      title: 'clang flags for Objective C',
      type: 'array',
      default: [],
      items: { type: 'string' }
    },
    buildPath: {
      title: 'the build pass used in clang-tools',
      type: 'string',
      default: 'compile_commands.json'
    }
  },

  activate (state) {
    initialize()

    this.clangTidyCommand = new ClangTidyCommand(
      atom.config.get('clang-tools-extra.clangTidyCommand'),
      atom.config.get('clang-tools-extra.buildPath')
    )
    this.clangRenameCommand = new ClangRenameCommand(
      atom.config.get('clang-tools-extra.clangRenameCommand'),
      atom.config.get('clang-tools-extra.buildPath')
    )

    this.clangArguments = new ClangArguments({
      getClangCFlags: () => atom.config.get('clang-tools-extra.clangCFlags').split(/\s+/),
      getClangCppFlags: () => atom.config.get('clang-tools-extra.clangCppFlags').split(/\s+/),
      getClangObjectiveCFlags: () => atom.config.get('clang-tools-extra.clangObjectiveCFlags').split(/\s+/),
      getClangObjectiveCppFlags: () => atom.config.get('clang-tools-extra.clangObjectiveCppFlags').split(/\s+/)<commit_msg>Fix main code<commit_after>'use babel'

let Disposable = null
let CompositeDisposable = null
let ClangTidyCommand = null
let ClangTidy = null
let ClangArguments = null
let ClangTidyLinter = null
let ClangTidyAutocompleteProvider = null
let ClangRenameCommand
let ClangRenameView = null

function initialize () {
  if (!Disposable || !CompositeDisposable) {
    const atom = require('atom')
    Disposable = atom.Disposable
    CompositeDisposable = atom.CompositeDisposable
  }
  if (!ClangTidyCommand) ClangTidyCommand = require('./clang-tidy-command')
  if (!ClangTidy) ClangTidy = require('./clang-tidy')
  if (!ClangArguments) ClangArguments = require('./clang-arguments')
  if (!ClangTidyLinter) ClangTidyLinter = require('./clang-tidy-linter')
  if (!ClangTidyAutocompleteProvider) {
    ClangTidyAutocompleteProvider = require('./clang-tidy-autocomplete-provider')
  }
  if (!ClangRenameCommand) ClangRenameCommand = require('./clang-rename-command')
  if (!ClangRenameView) ClangRenameView = require('./clang-rename-view')
}

export default {
  subscriptions: null,

  grammars: [
    'source.c',
    'source.cpp',
    'source.objc',
    'source.objcpp'
  ],

  config: {
    clangTidyCommand: {
      title: 'clang-tidy command',
      type: 'string',
      default: 'clang-tidy'
    },
    clangRenameCommand: {
      title: 'clang-rename command',
      type: 'string',
      default: 'clang-rename'
    },
    clangCppFlags: {
      title: 'clang flags for C++',
      type: [],
      items: { type: 'string' }
    },
    clangCFlags: {
      title: 'clang flags for C',
      type: 'array',
      default: [],
      items: { type: 'string' }
    },
    clangObjectiveCppFlags: {
      title: 'clang flags for Objective C++',
      type: 'array',
      default: [],
      items: { type: 'string' }
    },
    clangObjectiveCFlags: {
      title: 'clang flags for Objective C',
      type: 'array',
      default: [],
      items: { type: 'string' }
    },
    buildPath: {
      title: 'the build pass used in clang-tools',
      type: 'string',
      default: 'compile_commands.json'
    }
  },

  activate (state) {
    initialize()

    this.clangTidyCommand = new ClangTidyCommand(
      () => atom.config.get('clang-tools-extra.clangTidyCommand'),
      () => atom.config.get('clang-tools-extra.buildPath')
    )
    this.clangRenameCommand = new ClangRenameCommand(
      () => atom.config.get('clang-tools-extra.clangRenameCommand'),
      () => atom.config.get('clang-tools-extra.buildPath')
    )

    this.clangArguments = new ClangArguments({
      getClangCFlags: () => atom.config.get('clang-tools-extra.clangCFlags').split(/\s+/),
      getClangCppFlags: () => atom.config.get('clang-tools-extra.clangCppFlags').split(/\s+/),
      getClangObjectiveCFlags: () => atom.config.get('clang-tools-extra.clangObjectiveCFlags').split(/\s+/),
      getClangObjectiveCppFlags: () => atom.config.get('clang-tools-extra.clangObjectiveCppFlags').split(/\s+/)
{'fraction_non_alphanumeric': 0.1462837837837838, 'fraction_numerical': 0.0, 'mean_word_length': 3.2566498921639107, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5490708', 'n_tokens_mistral': 2015, 'n_tokens_neox': 1990, 'n_words': 357}