Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/readme updates 2019 #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,20 @@ class FooTestCase(TestCase):

Use CapitalizedCamelCase for class names, snake_case for everything else. Use CAPITALIZED_SNAKE_CASE for global consts. See the [Google style guide](https://google.github.io/styleguide/pyguide.html#Naming) for more.

* Prefer shorter names (3 words or less)
* Don't describe code. Names are placeholders and "mind hooks".
* Don't repeat what's implied in the module name or class names.
* Do use naming to avoid ambiguity.

## Function Length

* Prefer short and focused functions (less than 60 lines).
* Avoid single-line functions.
* If a function exceeds 40 lines and there is an easy opportunity for refactoring, do so.
* If there are more than 3 levels of indentation, try to refactor.

(Based on [Google Style Guide](https://google.github.io/styleguide/pyguide.html#318-function-length))

## Unused variables

If you want to assign a value to a variable that will not be used again, name the variable either `_` (python convention) or `unused_<something>` (less-well-known python convention). This will keep our lint checkers from complaining.
Expand Down Expand Up @@ -264,9 +278,9 @@ words = [
'fox', # note the trailing comma
]

user = (
User.objects.filter(name__icontains='joe').
values_list('user', 'username')
user = User.objects.filter(name__icontains='joe').values_list(
'user',
'username'
)

[{
Expand Down