formatOptions top-level property
Implementation
final List<Option> formatOptions = [
Option(
name: '--check',
description: 'Avoid writing any formatted files back; instead, exit with a non-zero status code if any files would have been modified, and zero otherwise'
),
Option(
name: '--diff',
description: 'Avoid writing any formatted files back; instead, exit with a non-zero status code and the difference between the current file and how the formatted file would look like'
),
Option(
name: '--extension',
description: 'List of mappings from file extension to language (one of `python`, `ipynb`, `pyi`). For example, to treat `.ipy` files as IPython notebooks, use `--extension ipy:ipynb`',
args: [
Arg(
name: 'extension',
isOptional: true
)
]
),
Option(
name: '--target-version',
description: 'The minimum Python version that should be supported',
args: [
Arg(
name: 'target_version',
isOptional: true,
suggestions: [
FigSuggestion(name: 'py37'),
FigSuggestion(name: 'py38'),
FigSuggestion(name: 'py39'),
FigSuggestion(name: 'py310'),
FigSuggestion(name: 'py311'),
FigSuggestion(name: 'py312'),
FigSuggestion(name: 'py313')
]
)
]
),
Option(
name: '--preview',
description: 'Enable preview mode; enables unstable formatting. Use `--no-preview` to disable'
),
Option(
name: ['-n', '--no-cache'],
description: 'Disable cache reads (env: RUFF_NO_CACHE=)'
),
Option(
name: '--cache-dir',
description: 'Path to the cache directory (env: RUFF_CACHE_DIR=)',
args: [
Arg(
name: 'cache_dir',
template: 'filepaths'
)
]
),
Option(
name: '--stdin-filename',
description: 'The name of the file when passing it through stdin',
args: [
Arg(
name: 'stdin_filename',
template: 'filepaths'
)
]
),
Option(
name: '--respect-gitignore',
description: 'Respect file exclusions via `.gitignore` and other standard ignore files'
),
Option(
name: '--exclude',
description: 'List of paths, used to omit files and/or directories from analysis',
args: [
Arg(
name: 'exclude',
isOptional: true
)
]
),
Option(
name: '--force-exclude',
description: 'Enforce exclusions, even for paths passed to Ruff directly on the command-line'
),
Option(
name: '--line-length',
description: 'Set the line-length',
args: [
Arg(
name: 'line_length',
isOptional: true
)
]
),
Option(
name: '--range',
description: 'When specified, Ruff will try to only format the code in the given range',
args: [
Arg(
name: 'range',
isOptional: true
)
]
)
];