Skip to content

Commit

Permalink
Preparing for release. (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewHambley authored Jan 25, 2022
1 parent a8a3f1c commit 2b291e9
Showing 1 changed file with 32 additions and 10 deletions.
42 changes: 32 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,45 @@ regarding this second option is maintained in the project wiki.
The command-line tool is not complicated to use:

`stylist [-help] [-verbose]
[-map-extension EXTENSION:LANGUAGE[:PREPROCESSOR:...]]
[-configuration FILENAME]
[-style NAME]
FILE ...`

The only required arguments are one or more filenames. These are the files
which will be checked. If a directory is specified then the tool will
automatically descend into it checking all files which it recognises by
extension.

If you wish to make the tool aware of new extensions then use the
`-map-extension` argument. It takes a colon separated list. The first item
is the plain extension (no preceding full-stop). After that comes the
language to understand the file as. Finally a list of zero or more
preprocessors to apply to the file before parsing.
If you want a running commentary of what the tool is doing then use the
`-verbose` argument.

For example: `stylist -map-extension spesh:fortran:fpp:pfp`
A configuration file may specified with `-configuration` . This file should be
formatted as documented below.

The keys for selecting language and preprocessor are found in `__main__.py`.
The configuration may define several styles, in which case one can be chosen
using the `-style` argument. If it is not then the first in the configuration
file will be used.

If you want a running commentary of what the tool is doing then use the
`-verbose` argument.
### Configuration File

The configuration file is in Windows `.ini` format.

The processing pipelines for different file types are specified in the
`file-pipe` section. Each key is the file extension and the value a colon
separated list of processors starting with the language. See `stylist -help`
for a list of processors.

```
[file-pipe]
x90=fortran:pfp:fpp
```

Styles are defined in sections called `style.<name>`. In this section is
expected a key `rules` with a comma separated list of rules as the value. These
rules may take parameters which are presented in parenthesis.

```
[style.<name>]
rules = FortranCharacterset, KindPattern(integer='i_.*', real='r_.*')
```

0 comments on commit 2b291e9

Please sign in to comment.