Skip to content

Commit 0d82b72

Browse files
committed
Merge branch 'master' into asyncio
2 parents ef01872 + 5749b84 commit 0d82b72

File tree

218 files changed

+12782
-11213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+12782
-11213
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
- [ ] added some tests for the functionality
77
- [ ] updated the documentation
88
- [ ] updated the changelog
9+
- [ ] reformat files using `black` (please check [Readme](https://github.com/RasaHQ/rasa_nlu#code-style) for instructions)

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/ambv/black
3+
rev: stable
4+
hooks:
5+
- id: black
6+
language_version: python3.6

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ after_success:
3535
- coveralls
3636
jobs:
3737
include:
38+
- stage: test
39+
name: "Black Formatting"
40+
python: 3.6
41+
script: pip install black; black --check .
3842
- stage: test
3943
name: "Test Codestyle"
4044
python: 3.6

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This project adheres to `Semantic Versioning`_ starting with version 1.0.
1111

1212
Added
1313
-----
14+
- add formatter 'black'
1415

1516
Changed
1617
-------

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,21 @@ Releasing a new version is quite simple, as the packages are build and distribut
131131
git push origin 0.7.x
132132
```
133133
134+
### Code Style
135+
136+
To ensure a standardized code style we use the formatter [black](https://github.com/ambv/black).
137+
If your code is not formatted properly, travis will fail to build.
138+
139+
If you want to automatically format your code on every commit, you can use [pre-commit](https://pre-commit.com/).
140+
Just install it via `pip install pre-commit` and execute `pre-commit install` in the root folder.
141+
This will add a hook to the repository, which reformats files on every commit.
142+
143+
If you want to set it up manually, install black via `pip install black`.
144+
To reformat files execute
145+
```
146+
black .
147+
```
148+
134149
## License
135150
Licensed under the Apache License, Version 2.0.
136151
Copyright 2019 Rasa Technologies GmbH. [Copy of the license](LICENSE.txt).

docs/core/api/events.rst

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ Set a Slot
3434
:Short: Event to set a slot on a tracker
3535
:JSON:
3636
.. literalinclude:: ../../../tests/core/test_events.py
37-
:lines: 2-
38-
:dedent: 8
37+
:lines: 1-
38+
:dedent: 4
3939
:start-after: # DOCS MARKER SetSlot
4040
:end-before: # DOCS END
4141
:Class:
@@ -54,8 +54,8 @@ Restart a conversation
5454
:Short: Resets anything logged on the tracker.
5555
:JSON:
5656
.. literalinclude:: ../../../tests/core/test_events.py
57-
:lines: 2-
58-
:dedent: 8
57+
:lines: 1-
58+
:dedent: 4
5959
:start-after: # DOCS MARKER Restarted
6060
:end-before: # DOCS END
6161
:Class:
@@ -74,8 +74,8 @@ Reset all Slots
7474
:Short: Resets all the slots of a conversation.
7575
:JSON:
7676
.. literalinclude:: ../../../tests/core/test_events.py
77-
:lines: 2-
78-
:dedent: 8
77+
:lines: 1-
78+
:dedent: 4
7979
:start-after: # DOCS MARKER AllSlotsReset
8080
:end-before: # DOCS END
8181
:Class:
@@ -94,8 +94,8 @@ Schedule a reminder
9494
:Short: Schedule an action to be executed in the future.
9595
:JSON:
9696
.. literalinclude:: ../../../tests/core/test_events.py
97-
:lines: 2-
98-
:dedent: 8
97+
:lines: 1-
98+
:dedent: 4
9999
:start-after: # DOCS MARKER ReminderScheduled
100100
:end-before: # DOCS END
101101
:Class:
@@ -112,8 +112,8 @@ Pause a conversation
112112
will be halted until resumed.
113113
:JSON:
114114
.. literalinclude:: ../../../tests/core/test_events.py
115-
:lines: 2-
116-
:dedent: 8
115+
:lines: 1-
116+
:dedent: 4
117117
:start-after: # DOCS MARKER ConversationPaused
118118
:end-before: # DOCS END
119119
:Class:
@@ -133,8 +133,8 @@ Resume a conversation
133133
predicting actions again.
134134
:JSON:
135135
.. literalinclude:: ../../../tests/core/test_events.py
136-
:lines: 2-
137-
:dedent: 8
136+
:lines: 1-
137+
:dedent: 4
138138
:start-after: # DOCS MARKER ConversationResumed
139139
:end-before: # DOCS END
140140
:Class:
@@ -154,8 +154,8 @@ Force a followup action
154154
to be a fixed one.
155155
:JSON:
156156
.. literalinclude:: ../../../tests/core/test_events.py
157-
:lines: 2-
158-
:dedent: 8
157+
:lines: 1-
158+
:dedent: 4
159159
:start-after: # DOCS MARKER FollowupAction
160160
:end-before: # DOCS END
161161
:Class:
@@ -178,8 +178,8 @@ User sent message
178178
:Short: Message a user sent to the bot.
179179
:JSON:
180180
.. literalinclude:: ../../../tests/core/test_events.py
181-
:lines: 2-
182-
:dedent: 8
181+
:lines: 1-
182+
:dedent: 4
183183
:start-after: # DOCS MARKER UserUttered
184184
:end-before: # DOCS END
185185
:Class:
@@ -198,8 +198,8 @@ Bot responded message
198198
:Short: Message a bot sent to the user.
199199
:JSON:
200200
.. literalinclude:: ../../../tests/core/test_events.py
201-
:lines: 2-
202-
:dedent: 8
201+
:lines: 1-
202+
:dedent: 4
203203
:start-after: # DOCS MARKER BotUttered
204204
:end-before: # DOCS END
205205
:Class:
@@ -219,8 +219,8 @@ Undo a user message
219219
(including the ``user`` event of the message).
220220
:JSON:
221221
.. literalinclude:: ../../../tests/core/test_events.py
222-
:lines: 2-
223-
:dedent: 8
222+
:lines: 1-
223+
:dedent: 4
224224
:start-after: # DOCS MARKER UserUtteranceReverted
225225
:end-before: # DOCS END
226226
:Class:
@@ -240,8 +240,8 @@ Undo an action
240240
(including the ``action`` event of the action).
241241
:JSON:
242242
.. literalinclude:: ../../../tests/core/test_events.py
243-
:lines: 2-
244-
:dedent: 8
243+
:lines: 1-
244+
:dedent: 4
245245
:start-after: # DOCS MARKER ActionReverted
246246
:end-before: # DOCS END
247247
:Class:
@@ -261,8 +261,8 @@ Log an executed action
261261
action created are logged separately.
262262
:JSON:
263263
.. literalinclude:: ../../../tests/core/test_events.py
264-
:lines: 2-
265-
:dedent: 8
264+
:lines: 1-
265+
:dedent: 4
266266
:start-after: # DOCS MARKER ActionExecuted
267267
:end-before: # DOCS END
268268
:Class:

0 commit comments

Comments
 (0)