From 4fb22f61e44c54d9b68ce74acf6958a1df655bf8 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Sat, 1 Dec 2018 22:45:10 +0100 Subject: [PATCH] Reference black, split long functions (#2651) Closes #2598 --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d347ff926..78b4cf086 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -188,6 +188,8 @@ you should know about. Style conventions for stub files are different from PEP 8. The general rule is that they should be as concise as possible. Specifically: * lines can be up to 130 characters long; +* functions and methods that don't fit in one line should be split up + with one argument per line; * all function bodies should be empty; * prefer ``...`` over ``pass``; * prefer ``...`` on the same line as the class/function signature; @@ -199,6 +201,8 @@ rule is that they should be as concise as possible. Specifically: * use variable annotations instead of type comments, even for stubs that target older versions of Python; * for arguments with a type and a default, use spaces around the `=`. +The code formatter [black](https://github.com/ambv/black) will format +stubs according to this standard. Stub files should only contain information necessary for the type checker, and leave out unnecessary detail: