From 4313f90dd8bb520a0b9a677a44af678db7f37e19 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 7 Jul 2024 20:49:27 -0700 Subject: [PATCH] Add a couple of more code style guidelines. --- docs/how-to/develop-on-borgmatic.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/how-to/develop-on-borgmatic.md b/docs/how-to/develop-on-borgmatic.md index 32d95f6c..57aca410 100644 --- a/docs/how-to/develop-on-borgmatic.md +++ b/docs/how-to/develop-on-borgmatic.md @@ -157,8 +157,12 @@ the following deviations from it: * Import fully qualified Python modules instead of importing individual functions, classes, or constants. E.g., do `import os.path` instead of `from os import path`. (Some exceptions to this are made in tests.) + * Only use classes and OOP as a last resort, such as when integrating with + Python libraries that require it. + * Prefer functional code where it makes sense, e.g. when constructing a + command (to subsequently execute imperatively). -borgmatic code uses the [Black](https://black.readthedocs.io/en/stable/) code +borgmatic uses the [Black](https://black.readthedocs.io/en/stable/) code formatter, the [Flake8](http://flake8.pycqa.org/en/latest/) code checker, and the [isort](https://github.com/timothycrosley/isort) import orderer, so certain code style requirements are enforced when running automated tests. See