Module: RuboCop::OptionsHelp Private

Defined in:
lib/rubocop/options.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

This module contains help texts for command line options. rubocop:disable Metrics/ModuleLength

Constant Summary collapse

MAX_EXCL =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

RuboCop::Options::DEFAULT_MAXIMUM_EXCLUSION_ITEMS.to_s
FORMATTER_OPTION_LIST =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

RuboCop::Formatter::FormatterSet::BUILTIN_FORMATTERS_FOR_KEYS.keys
TEXT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  only:                             'Run only the given cop(s).',
  only_guide_cops:                  ['Run only cops for rules that link to a',
                                     'style guide.'],
  except:                           'Exclude the given cop(s).',
  require:                          'Require Ruby file.',
  config:                           'Specify configuration file.',
  auto_gen_config:                  ['Generate a configuration file acting as a',
                                     'TODO list.'],
  regenerate_todo:                  ['Regenerate the TODO configuration file using',
                                     'the last configuration. If there is no existing',
                                     'TODO file, acts like --auto-gen-config.'],
  offense_counts:                   ['Include offense counts in configuration',
                                     'file generated by --auto-gen-config.',
                                     'Default is true.'],
  auto_gen_timestamp:
                                    ['Include the date and time when the --auto-gen-config',
                                     'was run in the file it generates. Default is true.'],
  auto_gen_enforced_style:
                                    ['Add a setting to the TODO configuration file to enforce',
                                     'the style used, rather than a per-file exclusion',
                                     'if one style is used in all files for cop with',
                                     'EnforcedStyle as a configurable option',
                                     'when the --auto-gen-config was run',
                                     'in the file it generates. Default is true.'],
  auto_gen_only_exclude:
                                    ['Generate only Exclude parameters and not Max',
                                     'when running --auto-gen-config, except if the',
                                     'number of files with offenses is bigger than',
                                     'exclude-limit. Default is false.'],
  exclude_limit:                    ['Set the limit for how many files to explicitly exclude.',
                                     'If there are more files than the limit, the cop will',
                                     "be disabled instead. Default is #{MAX_EXCL}."],
  disable_uncorrectable:            ['Used with --autocorrect to annotate any',
                                     'offenses that do not support autocorrect',
                                     'with `rubocop:todo` comments.'],
  no_exclude_limit:                 ['Do not set the limit for how many files to exclude.'],
  force_exclusion:                  ['Any files excluded by `Exclude` in configuration',
                                     'files will be excluded, even if given explicitly',
                                     'as arguments.'],
  only_recognized_file_types:       ['Inspect files given on the command line only if',
                                     'they are listed in `AllCops/Include` parameters',
                                     'of user configuration or default configuration.'],
  ignore_disable_comments:          ['Run cops even when they are disabled locally',
                                     'by a `rubocop:disable` directive.'],
  ignore_parent_exclusion:          ['Prevent from inheriting `AllCops/Exclude` from',
                                     'parent folders.'],
  ignore_unrecognized_cops:         ['Ignore unrecognized cops or departments in the config.'],
  force_default_config:             ['Use default configuration even if configuration',
                                     'files are present in the directory tree.'],
  format:                           ['Choose an output formatter. This option',
                                     'can be specified multiple times to enable',
                                     'multiple formatters at the same time.',
                                     *FORMATTER_OPTION_LIST.map do |item|
                                       "  #{item}#{' (default)' if item == '[p]rogress'}"
                                     end,
                                     '  custom formatter class name'],
  out:                              ['Write output to a file instead of STDOUT.',
                                     'This option applies to the previously',
                                     'specified --format, or the default format',
                                     'if no format is specified.'],
  fail_level:                       ['Minimum severity for exit with error code.',
                                     '  [A] autocorrect',
                                     '  [I] info',
                                     '  [R] refactor',
                                     '  [C] convention',
                                     '  [W] warning',
                                     '  [E] error',
                                     '  [F] fatal'],
  display_time:                     'Display elapsed time in seconds.',
  display_only_failed:              ['Only output offense messages. Omit passing',
                                     'cops. Only valid for --format junit.'],
  display_only_fail_level_offenses:
                                    ['Only output offense messages at',
                                     'the specified --fail-level or above'],
  display_only_correctable:         ['Only output correctable offense messages.'],
  display_only_safe_correctable:    ['Only output safe-correctable offense messages',
                                     'when combined with --display-only-correctable.'],
  show_cops:                        ['Shows the given cops, or all cops by',
                                     'default, and their configurations for the',
                                     'current directory.'],
  show_docs_url:                    ['Display url to documentation for the given',
                                     'cops, or base url by default.'],
  fail_fast:                        ['Inspect files in order of modification',
                                     'time and stop after the first file',
                                     'containing offenses.'],
  cache:                            ["Use result caching (FLAG=true) or don't",
                                     '(FLAG=false), default determined by',
                                     'configuration parameter AllCops: UseCache.'],
  cache_root:                       ['Set the cache root directory.',
                                     'Takes precedence over the configuration',
                                     'parameter AllCops: CacheRootDirectory and',
                                     'the $RUBOCOP_CACHE_ROOT environment variable.'],
  debug:                            'Display debug info.',
  display_cop_names:                ['Display cop names in offense messages.',
                                     'Default is true.'],
  disable_pending_cops:             'Run without pending cops.',
  display_style_guide:              'Display style guide URLs in offense messages.',
  enable_pending_cops:              'Run with pending cops.',
  extra_details:                    'Display extra details in offense messages.',
  lint:                             'Run only lint cops.',
  safe:                             'Run only safe cops.',
  stderr:                           ['Write all output to stderr except for the',
                                     'autocorrected source. This is especially useful',
                                     'when combined with --autocorrect and --stdin.'],
  list_target_files:                'List all files RuboCop will inspect.',
  autocorrect:                      'Autocorrect offenses (only when it\'s safe).',
  auto_correct:                     '(same, deprecated)',
  safe_auto_correct:                '(same, deprecated)',
  autocorrect_all:                  'Autocorrect offenses (safe and unsafe).',
  auto_correct_all:                 '(same, deprecated)',
  fix_layout:                       'Run only layout cops, with autocorrect on.',
  color:                            'Force color output on or off.',
  version:                          'Display version.',
  verbose_version:                  'Display verbose version.',
  parallel:                         ['Use available CPUs to execute inspection in',
                                     'parallel. Default is true.'],
  stdin:                            ['Pipe source from STDIN, using FILE in offense',
                                     'reports. This is useful for editor integration.'],
  init:                             'Generate a .rubocop.yml file in the current directory.',
  server:                           ['If a server process has not been started yet, start',
                                     'the server process and execute inspection with server.',
                                     'Default is false.',
                                     'You can specify the server host and port with the',
                                     '$RUBOCOP_SERVER_HOST and the $RUBOCOP_SERVER_PORT',
                                     'environment variables.'],
  restart_server:                   'Restart server process.',
  start_server:                     'Start server process.',
  stop_server:                      'Stop server process.',
  server_status:                    'Show server status.',
  no_detach:                        'Run the server process in the foreground.',
  lsp:                              'Start a language server listening on STDIN.',
  raise_cop_error:                  ['Raise cop-related errors with cause and location.',
                                     'This is used to prevent cops from failing silently.',
                                     'Default is false.'],
  profile:                          'Profile rubocop',
  memory:                           'Profile rubocop memory usage'
}.freeze