<commit_before>import os
import ycm_core

libDir = "lib"

flags = [

'-Wall'
,'-Wextra'
,'-Werror'
,'-Wno-attributes'

,'-std=c++11'
,'-x'
,'c++'

# You can add custom libraries here, but note that the script will automatically scan the 'lib' directory.
,'-I./lib/MyFirstLib'

# Add avr-libc and Arduino libs, custimize to your needs
,'-isystem/usr/local/Cellar/avr-libc/1.8.0/avr/include'
,'-isystem/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino'
,'-isystem/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/mega'
,'-I/Applications/Arduino.app/Contents/Resources/Java/libraries/Wire'

# Customize microcontroler and Arduino version
,'-mmcu=atmega2560'
,'-DF_CPU=16000000L'
,'-DARDUINO=105'
,'-D__AVR__'
,'-D__AVR_ATmega2560__'
#,'-MMD -DUSB_VID=null'
#,'-DUSB_PID=null'
]


compilation_database_folder = ''

if os.path.exists( compilation_database_folder ):
  database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
  database = None

SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.ino', '.m', '.mm' ]

def DirectoryOfThisScript():
  return os.path.dirname( os.path.abspath( __file__ ) )

def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
  if not working_directory:
    return list( flags )

  new_flags = []
  make_next_absolute = False<commit_msg>refactor flags and add documentation<commit_after>import os
import ycm_core

libDir = "lib"

flags = [
  # General flags
  '-Wall'
  ,'-Wextra'
  ,'-Werror'

  ,'-Wno-attributes'
  ,'-std=c++11'
  ,'-x'
  ,'c++'

  # avr-libc flags for 1.8.0 and 1.8.1 installed with homebrew
  # you can deleted the one you don't need
  ,'-isystem/usr/local/Cellar/avr-libc/1.8.0/avr/include'
  ,'-isystem/usr/local/Cellar/avr-libc/1.8.1/avr/include'

  # arduino libs flags when downloaded from the arduino website
  ,'-I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino'
  ,'-I/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/mega'
  ,'-I/Applications/Arduino.app/Contents/Resources/Java/libraries'

  # arduino libs flags when installed with brew cask
  # beware, the version number can change
  ,'-I/opt/homebrew-cask/Caskroom/arduino/1.0.6/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino'
  ,'-I/opt/homebrew-cask/Caskroom/arduino/1.0.6/Arduino.app/Contents/Resources/Java/hardware/arduino/variants/mega'
  ,'-I/opt/homebrew-cask/Caskroom/arduino/1.0.6/Arduino.app/Contents/Resources/Java/libraries'

  # for specific arduino libraries such as Wire.h, you need to add them by hand
  ,'-I/Applications/Arduino.app/Contents/Resources/Java/libraries/Wire'
  ,'-I/opt/homebrew-cask/Caskroom/arduino/1.0.6/Arduino.app/Contents/Resources/Java/libraries/Wire'

  # You can add custom libraries here, but note that the script will automatically scan the 'lib' directory.
  ,'-I./lib/MyFirstLib'

  # Customize microcontroler and Arduino version
  ,'-mmcu=atmega2560'
  ,'-DF_CPU=16000000L'
  ,'-DARDUINO=105'
  ,'-D__AVR__'
  ,'-D__AVR_ATmega2560__'

  # ,'-MMD -DUSB_VID=null'
  # ,'-DUSB_PID=null'
]


compilation_database_folder = ''

if os.path.exists( compilation_database_folder ):
  database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
  database = None

SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.ino', '.m', '.mm' ]

def DirectoryOfThisScript():
  return os.path.dirname( os.path.abspath( __file__ ) )

def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
  if not working_directory:
    return list( flags )

  new_flags = []
  make_next_absolute = False
{'fraction_non_alphanumeric': 0.14991717283268913, 'fraction_numerical': 0.019050248481501934, 'mean_word_length': 4.359467455621302, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '304573', 'n_tokens_mistral': 1460, 'n_tokens_neox': 1344, 'n_words': 246}