This document serves as a style guide for all jwst_magic
software development. Any requested contribution to the jwst_magic
code repository should be checked against this guide, and any violation of the guide should be fixed before the code is committed to
the master
branch.
It is assumed that the reader of this style guide has read and is familiar with the following:
- The PEP8 Style Guide for Python Code
- The PEP257 Docstring Conventions Style Guide
- The
numpydoc
docstring convention
All software development for the jwst_magic
project should follow a continuous integration workflow, described in the git
& GitLab Workflow for Contributing. Before committing any code changes, use a linter such as pylint
and with your editor to check against PEP8, PEP257, and numpydoc
docstring standards. Also check that your code is conforming to this style guide.
The following items should never be committed in the jwst_magic
source code or GitHub issues/pull requests:
- Account credentials of any kind (e.g. database usernames and passwords)
- Internal directory structures or filepaths
- Machine names
- Proprietary data
Additionally, developers of this project should be mindful of application security risks, and should adhere to the OWASP Top 10 as best possible.
jwst_magic
code shall adhere to the PEP8
conventions save for the following exceptions:
- Lines of code need not to be restricted to 79 characters. However, it is encouraged to break up obnoxiously long lines into several lines if it benefits the overall readability of the code
jwst_magic
code shall adhere to the PEP257
and numpydoc
conventions. The following are further recommendations:
- Each function/method should have at minimum a description,
Parameters
(if necessary), andReturns
(if necessary) sections
This workflow is adapted from the spacetelescope
jwql
Python Code Style Guide for jwql
.