Skip to content

Commit 69b98db

Browse files
committed
docs
1 parent 4880d44 commit 69b98db

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

.circleci/config.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
python3 -m venv venv
3434
. venv/bin/activate
3535
pip install -e .
36-
pip install green
36+
pip install green flake8
3737
3838
- save_cache:
3939
paths:
@@ -51,6 +51,12 @@ jobs:
5151
. venv/bin/activate
5252
green
5353
54+
- run:
55+
name: run static analysis
56+
command: |
57+
. venv/bin/activate
58+
flake8
59+
5460
- store_artifacts:
5561
path: test-reports
5662
destination: test-reports

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Then:
4242
`pip install -e path/to/snippet`
4343

4444
## configure
45-
Place a `.toml` [configuration file](https://github.com/toml-lang/toml)
46-
in your project directory. Any value defined in [the config object](https://github.com/ARMmbed/snippet/blob/22cb8b4af961b8c728ab6f4d9b91922823c6620f/src/snippet/config.py#L8)
45+
Place a config file in the [toml format](https://github.com/toml-lang/toml)
46+
in your project directory (e.g. `snippet.toml`). Any value defined in [the config object](https://github.com/ARMmbed/snippet/blob/master/src/snippet/config.py#L8)
4747
can be overridden.
4848

4949
As an example, basic configuration typically includes input and output directories:
@@ -65,19 +65,22 @@ Alternatively, run snippet from anywhere and specify a working directory and con
6565
```
6666
python -m snippet path/to/root --config=path/to/config.toml
6767
```
68+
Config files can be specified as glob patterns, defaulting to `*.toml`, and can
69+
be set multiple times. Multiple files will be loaded in the order specified
70+
and discovered. Settings loaded last will take precedence.
6871

6972
The full CLI options are:
7073
```
7174
> python -m snippet --help
7275
usage: __main__.py [-h] [--config CONFIG] [-v] [dir]
7376
7477
positional arguments:
75-
dir path to project root, used by relative paths in config
76-
[cwd]
78+
dir path to project root, used by any relative paths in loaded
79+
configs [cwd]
7780
7881
optional arguments:
7982
-h, --help show this help message and exit
80-
--config CONFIG path to config file
83+
--config CONFIG paths (or globs) to config files
8184
-v, --verbosity increase output verbosity
8285
```
8386

@@ -160,13 +163,13 @@ for item in items:
160163
```
161164

162165
## validation
163-
Because `snippet` is language-agnostic it is also unlikely that an
166+
Because `snippet` is language-agnostic it is unlikely that an
164167
IDE would detect invalid snippets, or changes to code that may break them.
165168

166169
`snippet` can be configured to validate snippets to avoid the syntax from
167170
introducing bizarre broken documentation to your users. That said, it can't
168171
do everything - and it's still wise to QA your docs from time to time.
169172
Some of the checks include:
170-
- Tag open / close matches (can't nest examples or cloaks)
173+
- Tag open / close matches (avoiding nested examples or cloaks)
171174
- Examples left unterminated
172175
- Indents reducing beyond the start level for the current example

tests/test_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def setUpClass(cls):
2424
[snippet]
2525
# an example: this config is itself an example
2626
input_glob = 'does not match anything'
27-
27+
2828
stop_on_first_failure = true
2929
end_flag = 'custom value'
30-
30+
3131
foo = 'bar'
3232
fizz = 'buzz'
3333
""").lstrip())

0 commit comments

Comments
 (0)