Merge branch 'readme' into 'master'

hacking: Clarify dev env and testing

See merge request Librem5/squeekboard!231
This commit is contained in:
Dorota Czaplejewicz
2019-11-13 13:44:03 +00:00

View File

@ -3,6 +3,25 @@ Hacking
This document describes the standards for modifying and maintaining the *squeekboard* project.
Development environment
-----------------------
*Squeekboard* is regularly built and tested on [the develpment environment](https://developer.puri.sm/Librem5/Development_Environment.html).
Recent Fedora releases are likely to be tested as well.
### Dependencies
On a Debian based system run
```sh
sudo apt-get -y install build-essential
sudo apt-get -y build-dep .
```
For an explicit list of dependencies check the `Build-Depends` entry in the
[debian/control][] file.
Testing
-------
@ -28,11 +47,64 @@ $ busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b false
Testing layouts:
Layouts can be selected using the GNOME Settings application.
```
# define all available layouts
$ gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'ua')]"
# choose the active layout
$ gsettings set org.gnome.desktop.input-sources current 1
```
Coding
------
Code submitted should roughly match the style of surrounding code. Things that will *not* be accepted are ones that often lead to errors:
- skipping brackets `{}` after every `if()`, `else`, and similar
Bad example:
```
if (foo)
bar();
```
Good example:
```
if (foo) {
bar();
}
```
- mixing tabs and spaces in the same block of code (or config)
Strongly encouraged:
- don't make lines too long. If it's longer than ~80 characters, it's probably unreadable already, and the code needs to be clarified;
- put operators in the beginning of a continuation line
Bad example:
```
foobar = verylongexpression +
anotherverylongexpression +
yetanotherexpression;
```
Good example:
```
foobar = verylongexpression
+ anotherverylongexpression
+ yetanotherexpression;
```
- use `///` for documentation comments in front of definitions and `/*! ... */` for documentation comments in the beginning of modules (see [Rust doc-comments](https://doc.rust-lang.org/reference/comments.html#doc-comments))
If in doubt, check [PEP8](https://github.com/rust-dev-tools/fmt-rfcs/blob/master/guide/guide.md), the [kernel coding style](https://www.kernel.org/doc/html/v4.10/process/coding-style.html), or the [Rust style guide](https://github.com/rust-dev-tools/fmt-rfcs/blob/master/guide/guide.md).
Maintenance
-----------