SPPAS

The automatic annotation and analysis of speech

SPPAS Code Style Guide

This page is part of the SPPAS Developer Documentation. It defines the internal conventions for writing, documenting, and maintaining the codebase. These rules ensure readability, accessibility, and long-term consistency across all SPPAS modules. They are intended for end-users, for internal maintenance and supervised development.

Full version available here: Download the Markdown file. See also the Code of Conduct.

To cite SPPAS in publications, please refer to the official citation file (CITATION.cff).

General Rules

Base Coding Rules

SPPAS follows the PEP8 style guide. Only the specific rules below override the base ones.

Commit Messages

Each commit message must follow the structure name.of.module: Action message, where "Action" includes but is not limited to "added", "fixed", "cleaned", "removed". Example: sppas.src.annotations.cuedspeech.model: Fixed test for model 4 -- custom rules. A long description is welcome explaining the reason(s) of these changes but not the changes themselves.

Naming

Formatting

Commenting

Comments are in American English, written as full sentences explaining what is not obvious. Rewrite unclear code instead of over-commenting.

Python Language

Docstrings

Short summary ≤79 chars. Markdown syntax limited to markdown2. Example:

def add(a: int, b: int) -> int:
     """Return the sum of two integers.
 
     :param a: (int) First value
     :param b: (int) Second value
     :return: (int) The sum
     """

Accessibility Justification

Rules are adapted to improve readability for visually impaired developers: no typing library, explicit comparisons, 119-char lines, clear logical flow.

JavaScript Language

Comments and Documentation

Use JSDoc syntax. Write concise comments in American English explaining the “why”.

/**
  * Fetch data from a given API endpoint.
  *
  * @param {string} url - The API endpoint to fetch data from.
  * @returns {Promise<Object>} The JSON response data.
  */
 async function fetchData(url) { ... }

See ClammingPy for more examples.