parameters: ()
return_statement: return result
docstring: Generate the option parser for this script.
docstring_summary: Generate the option parser for this script.
docstring_tokens: Generate the option parser for this script .
function: def GetOptions():
    """
    Generate the option parser for this script.
    """
    result = optparse.OptionParser()
    result.add_option(
      '-b',
      '--build-folder',
      help='Set V8 build folder',
      dest='build_folder',
      default=None)
    result.add_option(
      '-j',
      help='Set the amount of threads that should be used',
      dest='threads',
      default=None)
    result.add_option(
      '--gen-compdb',
      help='Generate a compilation database for clang-tidy',
      default=False,
      action='store_true')
    result.add_option(
      '--no-output-filter',
      help='Done use any output filterning',
      default=False,
      action='store_true')
    result.add_option(
      '--fix',
      help='Fix auto fixable issues',
      default=False,
      dest='auto_fix',
      action='store_true'
    )
  
    # Full clang-tidy.
    full_run_g = optparse.OptionGroup(result, 'Clang-tidy full', '')
    full_run_g.add_option(
      '--full',
      help='Run clang-tidy on the whole codebase',
      default=False,
      action='store_true')
    full_run_g.add_option('--checks',
                          help='Clang-tidy checks to use.',
                          default=None)
    result.add_option_group(full_run_g)
  
    # Aggregate clang-tidy.
    agg_run_g = optparse.OptionGroup(result, 'Clang-tidy aggregate', '')
    agg_run_g.add_option('--aggregate', help='Run clang-tidy on the whole '\
               'codebase and aggregate the warnings',
               default=False, action='store_true')
    agg_run_g.add_option('--show-loc', help='Show file locations when running '\
               'in aggregate mode', default=False,
               action='store_true')
    result.add_option_group(agg_run_g)
  
    # Diff clang-tidy.
    diff_run_g = optparse.OptionGroup(result, 'Clang-tidy diff', '')
    diff_run_g.add_option('--branch', help='Run clang-tidy on the diff '\
               'between HEAD and the merge-base between HEAD '\
               'and DIFF_BRANCH (origin/master by default).',
               default=None, dest='diff_branch')
    result.add_option_group(diff_run_g)
  
    # Single clang-tidy.
    single_run_g = optparse.OptionGroup(result, 'Clang-tidy single', '')
    single_run_g.add_option(
      '--single', help='', default=False, action='store_true')
    single_run_g.add_option(
      '--file', help='File name to check', default=None, dest='file_name')
    single_run_g.add_option('--lines', help='Limit checks to a line range. '\
                'For example: --lines="[2,4], [5,6]"',
                default=[], dest='line_ranges')
  
    result.add_option_group(single_run_g)
    return result
function_tokens: def GetOptions ( ) : result = optparse . OptionParser ( ) result . add_option ( '-b' , '--build-folder' , help = 'Set V8 build folder' , dest = 'build_folder' , default = None ) result . add_option ( '-j' , help = 'Set the amount of threads that should be used' , dest = 'threads' , default = None ) result . add_option ( '--gen-compdb' , help = 'Generate a compilation database for clang-tidy' , default = False , action = 'store_true' ) result . add_option ( '--no-output-filter' , help = 'Done use any output filterning' , default = False , action = 'store_true' ) result . add_option ( '--fix' , help = 'Fix auto fixable issues' , default = False , dest = 'auto_fix' , action = 'store_true' ) # Full clang-tidy. full_run_g = optparse . OptionGroup ( result , 'Clang-tidy full' , '' ) full_run_g . add_option ( '--full' , help = 'Run clang-tidy on the whole codebase' , default = False , action = 'store_true' ) full_run_g . add_option ( '--checks' , help = 'Clang-tidy checks to use.' , default = None ) result . add_option_group ( full_run_g ) # Aggregate clang-tidy. agg_run_g = optparse . OptionGroup ( result , 'Clang-tidy aggregate' , '' ) agg_run_g . add_option ( '--aggregate' , help = 'Run clang-tidy on the whole ' 'codebase and aggregate the warnings' , default = False , action = 'store_true' ) agg_run_g . add_option ( '--show-loc' , help = 'Show file locations when running ' 'in aggregate mode' , default = False , action = 'store_true' ) result . add_option_group ( agg_run_g ) # Diff clang-tidy. diff_run_g = optparse . OptionGroup ( result , 'Clang-tidy diff' , '' ) diff_run_g . add_option ( '--branch' , help = 'Run clang-tidy on the diff ' 'between HEAD and the merge-base between HEAD ' 'and DIFF_BRANCH (origin/master by default).' , default = None , dest = 'diff_branch' ) result . add_option_group ( diff_run_g ) # Single clang-tidy. single_run_g = optparse . OptionGroup ( result , 'Clang-tidy single' , '' ) single_run_g . add_option ( '--single' , help = '' , default = False , action = 'store_true' ) single_run_g . add_option ( '--file' , help = 'File name to check' , default = None , dest = 'file_name' ) single_run_g . add_option ( '--lines' , help = 'Limit checks to a line range. ' 'For example: --lines="[2,4], [5,6]"' , default = [ ] , dest = 'line_ranges' ) result . add_option_group ( single_run_g ) return result