File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -79,22 +79,31 @@ Contributing
79
79
When an implementation is added or modified, please review the following guidelines:
80
80
81
81
##### 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).
83
84
84
85
Run ` append_output.sh ` (e.g. ` ./append_output.sh borg.py ` ) to generate/update it.
85
86
86
87
##### Docstrings
87
88
Add module level description in form of a docstring with links to corresponding references or other useful information.
88
89
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,
90
93
but sometimes the shorter one as in [ template.py] ( patterns/behavioral/template.py ) would suffice.
91
94
92
95
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
+
93
98
94
99
##### Python2/3 compatibility
95
100
Try to keep it (discussion is held in [ issue #208 ] ( https://github.com/faif/python-patterns/issues/208 ) )
96
101
- use new style classes (inherit from ` object ` )
97
- - use ` from future import print `
102
+ - use ` from __future__ import print_function `
98
103
99
104
##### Update README
100
105
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 .
Original file line number Diff line number Diff line change 13
13
- "8.22. Implementing the Visitor Pattern Without Recursion"
14
14
15
15
*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
17
19
"""
18
20
19
21
You can’t perform that action at this time.
0 commit comments