Skip to content

Commit a25a65d

Browse files
committed
Update contributing guides
1 parent e5b253a commit a25a65d

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,31 @@ Contributing
7979
When an implementation is added or modified, please review the following guidelines:
8080

8181
##### Output
82-
All files with example patterns have `### OUTPUT ###` section at the bottom.
82+
All files with example patterns have `### OUTPUT ###` section at the bottom
83+
(migration to OUTPUT = """...""" is in progress).
8384

8485
Run `append_output.sh` (e.g. `./append_output.sh borg.py`) to generate/update it.
8586

8687
##### Docstrings
8788
Add module level description in form of a docstring with links to corresponding references or other useful information.
8889

89-
[strategy.py](patterns/behavioral/strategy.py) has a good example of detailed description,
90+
Add "Examples in Python ecosystem" section if you know some. It shows how patterns could be applied to real-world problems.
91+
92+
[facade.py](patterns/structural/facade.py) has a good example of detailed description,
9093
but sometimes the shorter one as in [template.py](patterns/behavioral/template.py) would suffice.
9194

9295
In some cases class-level docstring with doctest would also help (see [adapter.py](patterns/structural/adapter.py))
96+
but readable OUTPUT section is much better.
97+
9398

9499
##### Python2/3 compatibility
95100
Try to keep it (discussion is held in [issue #208](https://github.com/faif/python-patterns/issues/208))
96101
- use new style classes (inherit from `object`)
97-
- use `from future import print`
102+
- use `from __future__ import print_function`
98103

99104
##### Update README
100105
When everything else is done - update corresponding part of README.
106+
107+
108+
##### Travis CI
109+
Please run `flake8` and `pytest` commands locally to be sure your changes will pass CI .

patterns/behavioral/visitor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
- "8.22. Implementing the Visitor Pattern Without Recursion"
1414
1515
*Examples in Python ecosystem:
16-
Python's ast.NodeVisitor: https://github.com/python/cpython/blob/master/Lib/ast.py#L250
16+
- Python's ast.NodeVisitor: https://github.com/python/cpython/blob/master/Lib/ast.py#L250
17+
which is then being used e.g. in tools like `pyflakes`.
18+
- `Black` formatter tool implements it's own: https://github.com/ambv/black/blob/master/black.py#L718
1719
"""
1820

1921

0 commit comments

Comments
 (0)