Understanding the Salt Style Guide

If you've spent enough time in Python, then you're already familiar with the Style Guide for Python Code, also known as PEP 8. For those who have not seen it, or if you need a refresher, you can take a look at it here:

https://www.python.org/dev/peps/pep-0008/

There is also a guide to the Salt Coding Style, available at:

https://docs.saltstack.com/en/latest/topics/development/conventions/style.html

In general, Salt coding conventions follow PEP 8, but there are some key differences:

  • Quoting: One of the first conventions that new developers come across is that Salt uses single quotes (') instead of double quotes ("). This applies to everything from string formatting to docstrings.
  • Line length: It is very common ...

Get Extending SaltStack now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.