Skip to content

Latest commit

 

History

History
33 lines (18 loc) · 1.41 KB

GUIDELINES.md

File metadata and controls

33 lines (18 loc) · 1.41 KB

Guidelines

This file has guidelines for contributing to this repo

Being a hypermodern Pythonista builder

This repo has has an "opinionated" and "safety-first" view on Python code.

  • Opinionated: All code is run through black, an "uncompromising code formatter"
  • All code is linted with flake8. Multiple flake8 subpackages are used, including flake8-black, flake8-bandit, flake8-bugbear, and flake8-import-order.
  • Static type checking is done with mypy
  • Safety is used to check for installed dependencies with security vulnerabilities.

Run make thorough to run your code against all of these tools.

But, why?

If you are a lone dev on a project, maybe all of this isn't for you. But if someone else is reading or maintaining your code, these tools will provide a solid basis for good-code-hygiene-oriented development.

image

Write code, mostly functions, not too much

Michael Pollan famously authored these three key rules for healthy eating:

  • Eat food
  • Mostly plants
  • Not too much

This project is "vegetarian": Python classes are to be used sparingly. Composition is favored over inheritance, when used.