formatSpec top-level property

FigSpec formatSpec
final

Completion spec for format CLI

Implementation

final FigSpec formatSpec = FigSpec(
  name: 'format',
  description: 'Dotnet format is a code formatter that applies style preferences to a project or solution. Preferences will be read from an .editorconfig file, if present, otherwise a default set of preferences will be used',
  args: [
    Arg(
    name: 'project',
    description: 'The MSBuild project or solution to run code formatting on. If a project or solution file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in proj or sln, and uses that file',
    isOptional: true
  )
  ],
  options: [

    Option(
      name: '--diagnostics',
      description: 'A space-separated list of diagnostic IDs to use as a filter when fixing code style or third party issues. Default value is whichever IDs are listed in the editorconfig file',
      args: [
        Arg(
        name: 'diagnostics'
      )
      ]
    ),
    Option(
      name: '--severity',
      description: 'The minimum severity of diagnostics to fix. Allowed values are info, warn, and error. The default value is warn',
      args: [
        Arg(
        name: 'severity',
        isOptional: true,
        defaultValue: 'warn',
        suggestions: [

          FigSuggestion(name: 'info'),
          FigSuggestion(name: 'warn'),
          FigSuggestion(name: 'error')
        ]
      )
      ]
    ),
    Option(
      name: '--no-restore',
      description: 'Doesn\'t execute an implicit restore before formatting. Default is to do implicit restore'
    ),
    Option(
      name: '--verify-no-changes',
      description: 'Verifies that no formatting changes would be performed. Terminates with a non zero exit code if any files would have been formatted'
    ),
    Option(
      name: '--include',
      description: 'A space-separated list of relative file or folder paths to include in formatting. All files in the solution or project are formatted if empty',
      args: [
        Arg(
        name: 'paths',
        template: ['folders', 'filepaths']
      )
      ]
    ),
    Option(
      name: '--exclude',
      description: 'A space-separated list of relative file or folder paths to exclude from formatting. The default is none',
      args: [
        Arg(
        name: 'paths',
        template: ['folders', 'filepaths']
      )
      ]
    ),
    Option(
      name: '--include-generated',
      description: 'Formats files generated by the SDK'
    ),
    Option(
      name: ['-v', '--verbosity'],
      description: 'Sets the verbosity level of the command. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]. Not supported in every command. See specific command page to determine if this option is available',
      args: [
        Arg(
        name: 'verbosity',
        suggestions: [

          FigSuggestion(name: 'quiet'),
          FigSuggestion(name: 'minimal'),
          FigSuggestion(name: 'normal'),
          FigSuggestion(name: 'detailed'),
          FigSuggestion(name: 'diagnostic')
        ]
      )
      ]
    ),
    Option(
      name: '--binarylog',
      description: 'Logs all project or solution load information to a binary log file',
      args: [
        Arg(
        name: 'log',
        template: 'filepaths'
      )
      ]
    ),
    Option(
      name: '--report',
      description: 'Produces a JSON report in the directory specified by <REPORT_PATH>',
      args: [
        Arg(
        name: 'path',
        template: 'folders'
      )
      ]
    )
  ]
);