Configuration files.
Settings (see ffmt_settings) are read from the nearest of these, searching from a file's directory upward:
.fformat.tomlfpm.toml, in an [extra.fformat] tableSettings are written as in the table of ffmt_settings, with spaces and case as tables:
indent = 3
line-length = 100
[spaces]
comma = "add"
[case]
keywords = "lower"
[files]
extensions = ["f90", "F90"]
exclude = ["build", "legacy/*.f90"]
The [files] table controls which files are formatted when a directory is given.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=*), | private, | parameter | :: | CONFIG_NAME | = | '.fformat.toml' |
The settings of one configuration file.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(string_t), | public, | allocatable | :: | exclude(:) |
|
||
| type(string_t), | public, | allocatable | :: | extensions(:) |
|
||
| character(len=:), | public, | allocatable | :: | path |
the file, or |
||
| type(setting_t), | public, | allocatable | :: | settings(:) |
the formatting settings, in the order they are applied |
A configuration with nothing set.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(config_t), | intent(out) | :: | cfg |
set to have no file, no settings and no |
The configuration for files in directory dir (an absolute path): from the nearest config file
in dir or its parents. cfg%path is '' if there is none.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | dir |
absolute path of the directory |
||
| type(config_t), | intent(out) | :: | cfg |
the configuration found |
||
| integer, | intent(out) | :: | stat |
nonzero if the config file found cannot be read |
||
| character(len=:), | intent(out), | allocatable | :: | errmsg |
what is wrong, with the file name, if |
Read the configuration in file path: the whole file, or with fpm its
[extra.fformat] table. found is false if an fpm.toml has no such table.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | path |
the TOML file |
||
| logical, | intent(in) | :: | fpm |
|
||
| type(config_t), | intent(out) | :: | cfg |
the configuration; empty if not |
||
| logical, | intent(out) | :: | found |
the file has a configuration |
||
| integer, | intent(out) | :: | stat |
nonzero for bad TOML, an unknown key or a bad value |
||
| character(len=:), | intent(out), | allocatable | :: | errmsg |
what is wrong, with the file name, if |