"Fossies" - the Fresh Open Source Software Archive

Member "firefox-69.0.1/remote/doc/CodeStyle.md" (17 Sep 2019, 2686 Bytes) of package /linux/www/firefox-69.0.1.source.tar.xz:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Style guide

Like other projects, we also have some guidelines to keep to the code. For the overall remote agent project, a few rough rules are:


We keep our documentation (what you are reading right now!) in-tree under remote/doc. Updates and minor changes to documentation should ideally not be scrutinised to the same degree as code changes to encourage frequent updates so that documentation does not go stale. To that end, documentation changes with r=me a=doc from anyone with commit access level 3 are permitted.

Use fmt(1) or an equivalent editor specific mechanism (such as Meta-Q in Emacs) to format paragraphs at a maximum of 75 columns with a goal of roughly 65. This is equivalent to fmt -w75 -g65, which happens to the default on BSD and macOS.

The documentation can be built locally this way:

% ./mach doc remote


The remote agent consists mostly of JavaScript code, and we lint that using mozlint, which is harmonises different linters including eslint.

To run the linter and get sensible output:

% ./mach lint -funix remote

For certain classes of style violations, eslint has an automatic mode for fixing and formatting code. This is particularly useful to keep to whitespace and indentation rules:

% ./mach eslint --fix remote

The linter is also run as a try job (shorthand ES) which means any style violations will automatically block a patch from landing (if using Autoland) or cause your changeset to be backed out (if landing directly on inbound).

If you use git(1) you can enable automatic linting before you push to a remote through a pre-push (or pre-commit) hook. This will run the linters on the changed files before a push and abort if there are any problems. This is convenient for avoiding a try run failing due to a simple linting issue.