AlignSettingsSection¶
Align statements in *** Settings *** section to columns.
Disabling the formatter
AlignSettingsSection is included in the default formatters, but it can be also run separately with:
You can also disable it:
Align up to columns¶
You can configure how many columns should be aligned to the longest token in the given column. The remaining columns
will use fixed length separator length --space-count. By default, only the first two columns are aligned.
Example of how the AlignSettingsSection formatter behaves with the default configuration and multiple columns:
You can configure it to align three columns:
will result in:
To align all columns set up_to_column to 0.
Extra indent for keyword arguments¶
Arguments in multi-line settings are indented by additional argument_indent (default 4) spaces.
You can configure the indent or disable it by setting argument_indent to 0.
WITH NAME arguments are not indented:
Fixed the width of the column¶
It's possible to set the fixed width of the column. To configure it use fixed_width parameter:
This configuration respects up_to_column parameter but ignores argument_indent.
Minimal width of the column¶
It's possible to set the minimal width of the column. To configure it use min_width parameter:
This configuration respects up_to_column parameter.
Select lines to format¶
AlignSettingsSection does also support global formatting params --start-line and --end-line:
will result in:
Skip formatting¶
It is possible to use the following arguments to skip formatting of the code:
- skip option (
--skip documentation)
It is highly recommended to use one of the skip options if you wish to use the alignment, but you have part of the
code that looks better with manual alignment. It is also possible to use disablers but skip option
makes it easier to skip all instances of the given type of code.