Skip to content
Merged
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
15 changes: 15 additions & 0 deletions dev-guidelines/guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ high-level, mid-level and low-level sections below, and so does the `syft-pr-rev

- Keep the condition for doing something in the caller, not inside the function. When the function
really must check the condition itself, prefix its name with `maybe_`, as in `maybe_do_x()`.

This also covers a function that returns a value or None, where None means "skip this". Ask the
question with a separate function instead:

```python
# not this
note = job._log_note(log_file)
if note:
text += note

# but this
if job.log_is_truncated(log_file):
text += LOG_TRUNCATION_MESSAGE
```

- Aim for 20 lines. A reviewer flags a function or method over 40 lines, unless it:

- makes many calls to other functions,
Expand Down
Loading