Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

472 B
Raw Blame

paths: - "**/*.py"

Python Code

  • Don't use Any type annotations without comments justifying it.

  • Don't use cursor.execute() with string formatting (SQL injection risk)

  • Don't use .extra() in Django without careful review and commenting

  • Don't create N+1 query patterns:

    # BAD
    for bar in bars:
        foo = Foo.objects.get(id=bar.foo_id)
    
    # GOOD
    foos = {f.id: f for f in Foo.objects.filter(id__in=[b.foo_id for b in bars])}