format_options_t Derived Type

type, public :: format_options_t

All options that control formatting. The defaults give 4-space indentation with the bodies of modules and programs not indented, and aligned continuation lines.


Inherits

type~~format_options_t~~InheritsGraph type~format_options_t format_options_t type~case_options_t case_options_t type~format_options_t->type~case_options_t letter_case type~whitespace_options_t whitespace_options_t type~format_options_t->type~whitespace_options_t spaces

Components

Type Visibility Attributes Name Initial
integer, public :: base_indent = 0

columns added to the indentation of every line, so that even program units are indented (4 for code that starts in column 5)

integer, public :: comment_spacing = -1

blanks before a trailing comment, or -1 to keep them; comments aligned with one on the line before or after are kept

integer, public :: continuation = CONT_ALIGN

layout of continuation lines (CONT_ALIGN or CONT_INDENT)

integer, public :: continuation_indent = 4

extra indentation of continuation lines, used with CONT_INDENT and when there is nothing to align with

integer, public :: indent = 4

spaces per indentation level

logical, public :: indent_comments = .true.

re-indent comment lines like the code around them

logical, public :: indent_fypp = .false.

indent the code inside fypp blocks (#:if, #:for, #:def, ...), and the fypp directive lines with the code around them

logical, public :: indent_procedures = .true.

indent the bodies of subroutines and functions

logical, public :: indent_units = .false.

indent the bodies of modules, submodules and main programs

logical, public :: keep_column1_comments = .false.

leave comment lines that start in column 1 there (with indent_comments)

type(case_options_t), public :: letter_case

letter case of keywords and operators

integer, public :: line_length = 132

maximum line length (0 for no limit). Alignment that would make a line longer falls back to a smaller indentation.

integer, public :: relational = REL_KEEP

spelling of relational operators: REL_KEEP, REL_SYMBOLS (.lt. becomes <) or REL_LETTERS (< becomes .lt.)

logical, public :: sort_use = .false.

sort the use statements of each group by module name

logical, public :: sort_use_only = .false.

sort the names in only: lists

type(whitespace_options_t), public :: spaces

whitespace rules within lines

logical, public :: split_lines = .true.

split code lines that are longer than line_length


Source Code

type, public :: format_options_t
    !! All options that control formatting. The defaults give 4-space indentation with the bodies
    !! of modules and programs not indented, and aligned continuation lines.
    integer :: indent = 4                   !! spaces per indentation level
    integer :: base_indent = 0              !! columns added to the indentation of every line, so that even
                                            !! program units are indented (4 for code that starts in column 5)
    logical :: indent_units = .false.       !! indent the bodies of modules, submodules and main programs
    logical :: indent_procedures = .true.   !! indent the bodies of subroutines and functions
    logical :: indent_fypp = .false.        !! indent the code inside fypp blocks (`#:if`, `#:for`, `#:def`, ...),
                                            !! and the fypp directive lines with the code around them
    integer :: continuation = CONT_ALIGN    !! layout of continuation lines (`CONT_ALIGN` or `CONT_INDENT`)
    integer :: continuation_indent = 4      !! extra indentation of continuation lines, used with `CONT_INDENT`
                                            !! and when there is nothing to align with
    logical :: indent_comments = .true.     !! re-indent comment lines like the code around them
    logical :: keep_column1_comments = .false. !! leave comment lines that start in column 1 there (with
                                            !! `indent_comments`)
    integer :: line_length = 132            !! maximum line length (0 for no limit). Alignment that would make a
                                            !! line longer falls back to a smaller indentation.
    logical :: split_lines = .true.         !! split code lines that are longer than `line_length`
    integer :: relational = REL_KEEP        !! spelling of relational operators: `REL_KEEP`, `REL_SYMBOLS`
                                            !! (`.lt.` becomes `<`) or `REL_LETTERS` (`<` becomes `.lt.`)
    logical :: sort_use = .false.           !! sort the `use` statements of each group by module name
    logical :: sort_use_only = .false.      !! sort the names in `only:` lists
    integer :: comment_spacing = -1         !! blanks before a trailing comment, or -1 to keep them; comments
                                            !! aligned with one on the line before or after are kept
    type(whitespace_options_t) :: spaces    !! whitespace rules within lines
    type(case_options_t) :: letter_case     !! letter case of keywords and operators
end type format_options_t