Skip to content

Commit 5c26220

Browse files
Sturla22stla
andauthored
Document development environment (ikeyasu#26)
Co-authored-by: stla <[email protected]>
1 parent 1596592 commit 5c26220

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- repo: https://github.com/pocc/pre-commit-hooks
7+
rev: python
8+
hooks:
9+
- id: clang-format
10+
args: [-i]
11+
exclude: 'libraries/.*'

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,43 @@ Open ayab.ino in Arduino IDE.
2525
Press 'verify' to check that your setup is in good shape.
2626

2727
Press 'upload' to update your AYAB hardware with new firmware.
28+
29+
## Development Environment
30+
31+
To set up a working development environment follow these steps:
32+
33+
1. Install the Arduino IDE version 1.0.6 into a tools directory in your $HOME directory.
34+
35+
```bash
36+
cd ~/tools
37+
wget http://downloads.arduino.cc/arduino-1.0.6-linux64.tgz
38+
tar xf arduino-1.0.6-linux64.tgz
39+
```
40+
Running ./build.sh should work now.
41+
42+
2. Install clang-format and gcovr
43+
44+
Ubuntu:
45+
```bash
46+
sudo apt install clang-format gcovr
47+
```
48+
49+
3. Install [pre-commit](https://pre-commit.com/) via pip and use it to install git hooks
50+
51+
```bash
52+
pip3 install --user pre-commit
53+
pre-commit install
54+
```
55+
56+
4. Optionally create a pre-push hook
57+
58+
Add the following snippet in a file called .git/hooks/pre-push
59+
```bash
60+
#!/bin/bash
61+
set -e
62+
63+
./build.sh
64+
make clean
65+
./test/test.sh
66+
```
67+

0 commit comments

Comments
 (0)