authelia/docs/contributing/style-guide.md

1.6 KiB

layout title parent nav_order
default Style Guide Contributing 4

Style Guide

This is a general guide to the code style we aim to abide by. This is by no means an exhaustive list and we're constantly changing and improving it. This is also a work in progress document.

For our commit messages please see our Commit Message Guidelines.

Tools

We implement the following tools that help us abide by our style guide and include the configuration for them inside our repository:

Exceptions

This is a style guide not a cudgel, there are always going to be exceptions to these guidelines when it makes sense not to follow them. One notable exception is the README.md for the repository. The line length of the All Contributors individual sections are longer than 120 characters and it doesn't make sense to apply the line length guidelines.

Specific Guidelines

Line Length

We aim to keep all files to a maximum line length of 120 characters. This allows for most modern computer systems to display two files side by side (vertically split). As always, keep in mind you should not restrict your line length when it doesn't make sense to.

This includes but is not limited to the following file types:

  • Go (*.go)
  • YAML (*.yml, *.yaml)
  • Markdown (*.md)
  • JavaScript (*.js)
  • TypeScript (*.ts, *.tsx)