diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-10-31 21:10:28 -0700 |
---|---|---|
committer | Paul McGuire <ptmcg@users.noreply.github.com> | 2019-10-31 23:10:28 -0500 |
commit | 53d1b4a6f48a53c4c4ec4ac7031362b691c0366d (patch) | |
tree | 088ad3cf3561b78a00af4fb2fd474f4a2b8ca70c /CONTRIBUTING.md | |
parent | 41752aa52cc97c710474bb2972cceab057b52ad4 (diff) | |
download | pyparsing-git-53d1b4a6f48a53c4c4ec4ac7031362b691c0366d.tar.gz |
Blacken the project (#141)
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r-- | CONTRIBUTING.md | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0c405a0..6dcb0f3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -39,22 +39,22 @@ If you have a question on using pyparsing, there are a number of resources avail If you are considering proposing updates to pyparsing, please bear in mind the following guidelines. -Please review [_The Zen of Pyparsing_ and _The Zen of Pyparsing -Development_](https://github.com/pyparsing/pyparsing/wiki/Zen) -article on the pyparsing wiki, to get a general feel for the historical and future approaches to pyparsing's +Please review [_The Zen of Pyparsing_ and _The Zen of Pyparsing +Development_](https://github.com/pyparsing/pyparsing/wiki/Zen) +article on the pyparsing wiki, to get a general feel for the historical and future approaches to pyparsing's design, and intended developer experience as an embedded DSL. ## Some design points -- Minimize additions to the module namespace. Over time, pyparsing's namespace has acquired a *lot* of names. - New features have been encapsulated into namespace classes to try to hold back the name flooding when importing +- Minimize additions to the module namespace. Over time, pyparsing's namespace has acquired a *lot* of names. + New features have been encapsulated into namespace classes to try to hold back the name flooding when importing pyparsing. - New operator overloads will need to show broad applicability. - Performance tuning should focus on parse time performance. Optimizing parser definition performance is secondary. -- New external dependencies will require substantial justification, and if included, will need to be guarded for +- New external dependencies will require substantial justification, and if included, will need to be guarded for `ImportError`s raised if the external module is not installed. ## Some coding points @@ -66,7 +66,7 @@ These coding styles are encouraged whether submitting code for core pyparsing or future trend in coding styles. There are plans to convert these names to PEP8-conformant snake case, but this will be done over several releases to provide a migration path for current pyparsing-dependent applications. See more information at the [PEP8 wiki page](https://github.com/pyparsing/pyparsing/wiki/PEP-8-planning). - + If you wish to submit a new example, please follow PEP8 name and coding guidelines. Example code must be available for distribution with the rest of pyparsing under the MIT open source license. @@ -84,7 +84,7 @@ These coding styles are encouraged whether submitting code for core pyparsing or - str.format() statements should use named format arguments (unless this proves to be a slowdown at parse time). -- List, tuple, and dict literals should include a trailing comma after the last element, which reduces changeset +- List, tuple, and dict literals should include a trailing comma after the last element, which reduces changeset clutter when another element gets added to the end. - Examples should import pyparsing and the common namespace classes as: @@ -99,19 +99,19 @@ These coding styles are encouraged whether submitting code for core pyparsing or - Where possible use operators to create composite parse expressions: expr = expr_a + expr_b | expr_c - + instead of: - + expr = pp.MatchFirst([pp.And([expr_a, expr_b]), expr_c]) Exception: if using a generator to create an expression: - + import keyword python_keywords = keyword.kwlist - any_keyword = pp.MatchFirst(pp.Keyword(kw) + any_keyword = pp.MatchFirst(pp.Keyword(kw) for kw in python_keywords)) -- Learn [The Classic Blunders](https://github.com/pyparsing/pyparsing/wiki/The-Classic-Blunders) and +- Learn [The Classic Blunders](https://github.com/pyparsing/pyparsing/wiki/The-Classic-Blunders) and how to avoid them when developing new examples. - New features should be accompanied with updates to unitTests.py and a bullet in the CHANGES file. |