Skip to content

Commit 8016a93

Browse files
Add astyle format, boards.txt, and package check (#166)
Miscellaneous CI checks for code style, boards.txt update, and that all referenced packages are available.
1 parent fd4f7bb commit 8016a93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1616
-1551
lines changed

.github/workflows/pull-request.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,29 @@ jobs:
1717
- uses: actions/checkout@v2
1818
with:
1919
submodules: true
20-
- uses: actions/setup-python@v2
21-
with:
22-
python-version: '3.x'
2320
- name: Run codespell
2421
uses: codespell-project/actions-codespell@master
2522
with:
2623
skip: ./pico-extras,./ArduinoCore-API,./libraries/SdFat,./libraries/Adafruit_TinyUSB_Arduino,./libraries/LittleFS/lib,./tools/pyserial,./pico-sdk,./.github,./docs/i2s.rst
2724
ignore_words_list: ser,DOUT
2825

26+
# Consistent style
27+
astyle:
28+
name: Style, Boards, Package
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
with:
33+
submodules: false
34+
- run: |
35+
./tests/ci/pkgrefs_test.sh
36+
./tools/makeboards.py > boards.txt
37+
sudo apt update
38+
sudo apt install astyle
39+
./tests/restyle.sh
40+
# If anything changed, GIT should return an error and fail the test
41+
git diff --quiet --exit-code
42+
2943
# Build all examples on linux (core and Arduino IDE)
3044
build-linux:
3145
name: Build ${{ matrix.chunk }}

cores/rp2040/Arduino.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/*
2-
* Arduino header for the Raspberry Pi Pico RP2040
3-
*
4-
* Copyright (c) 2021 Earle F. Philhower, III <[email protected]>
5-
*
6-
* This library is free software; you can redistribute it and/or
7-
* modify it under the terms of the GNU Lesser General Public
8-
* License as published by the Free Software Foundation; either
9-
* version 2.1 of the License, or (at your option) any later version.
10-
*
11-
* This library is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14-
* Lesser General Public License for more details.
15-
*
16-
* You should have received a copy of the GNU Lesser General Public
17-
* License along with this library; if not, write to the Free Software
18-
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19-
*/
2+
Arduino header for the Raspberry Pi Pico RP2040
3+
4+
Copyright (c) 2021 Earle F. Philhower, III <[email protected]>
5+
6+
This library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
This library is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
Lesser General Public License for more details.
15+
16+
You should have received a copy of the GNU Lesser General Public
17+
License along with this library; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
*/
2020

2121
#ifndef Arduino_h
2222
#define Arduino_h
@@ -49,7 +49,7 @@ using std::abs;
4949
#endif
5050

5151
#ifdef __cplusplus
52-
extern "C"{
52+
extern "C" {
5353
#endif // __cplusplus
5454

5555
// For compatibility to many platforms and libraries
@@ -109,10 +109,10 @@ unsigned long millis();
109109
#ifdef __cplusplus
110110

111111
#ifdef USE_TINYUSB
112-
// Needed for declaring Serial
113-
#include "Adafruit_USBD_CDC.h"
112+
// Needed for declaring Serial
113+
#include "Adafruit_USBD_CDC.h"
114114
#else
115-
#include "SerialUSB.h"
115+
#include "SerialUSB.h"
116116
#endif
117117

118118
#include "SerialUART.h"
@@ -123,7 +123,7 @@ unsigned long millis();
123123
// with the specified bits set.
124124
template <size_t N>
125125
constexpr uint32_t __bitset(const int (&a)[N], size_t i = 0U) {
126-
return i < N ? (1L << a[i]) | __bitset(a, i+1) : 0;
126+
return i < N ? (1L << a[i]) | __bitset(a, i + 1) : 0;
127127
}
128128
#endif
129129

cores/rp2040/Bootsel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3-
*
4-
* SPDX-License-Identifier: BSD-3-Clause
5-
*/
2+
Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3+
4+
SPDX-License-Identifier: BSD-3-Clause
5+
*/
66
#include <Arduino.h>
77
#include "pico/stdlib.h"
88
#include "hardware/gpio.h"

cores/rp2040/Bootsel.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/*
2-
* Simple BOOTSEL reader object
3-
*
4-
* Copyright (c) 2021 Earle F. Philhower, III <[email protected]>
5-
*
6-
* This library is free software; you can redistribute it and/or
7-
* modify it under the terms of the GNU Lesser General Public
8-
* License as published by the Free Software Foundation; either
9-
* version 2.1 of the License, or (at your option) any later version.
10-
*
11-
* This library is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14-
* Lesser General Public License for more details.
15-
*
16-
* You should have received a copy of the GNU Lesser General Public
17-
* License along with this library; if not, write to the Free Software
18-
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19-
*/
2+
Simple BOOTSEL reader object
3+
4+
Copyright (c) 2021 Earle F. Philhower, III <[email protected]>
5+
6+
This library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
This library is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
Lesser General Public License for more details.
15+
16+
You should have received a copy of the GNU Lesser General Public
17+
License along with this library; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
*/
2020

2121
#pragma once
2222

cores/rp2040/CoreMutex.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
/*
2-
* CoreMutex for the Raspberry Pi Pico RP2040
3-
*
4-
* Implements a deadlock-safe multicore mutex for sharing things like the
5-
* USB or UARTs.
6-
*
7-
* Copyright (c) 2021 Earle F. Philhower, III <[email protected]>
8-
*
9-
* This library is free software; you can redistribute it and/or
10-
* modify it under the terms of the GNU Lesser General Public
11-
* License as published by the Free Software Foundation; either
12-
* version 2.1 of the License, or (at your option) any later version.
13-
*
14-
* This library is distributed in the hope that it will be useful,
15-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17-
* Lesser General Public License for more details.
18-
*
19-
* You should have received a copy of the GNU Lesser General Public
20-
* License along with this library; if not, write to the Free Software
21-
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22-
*/
2+
CoreMutex for the Raspberry Pi Pico RP2040
3+
4+
Implements a deadlock-safe multicore mutex for sharing things like the
5+
USB or UARTs.
6+
7+
Copyright (c) 2021 Earle F. Philhower, III <[email protected]>
8+
9+
This library is free software; you can redistribute it and/or
10+
modify it under the terms of the GNU Lesser General Public
11+
License as published by the Free Software Foundation; either
12+
version 2.1 of the License, or (at your option) any later version.
13+
14+
This library is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
Lesser General Public License for more details.
18+
19+
You should have received a copy of the GNU Lesser General Public
20+
License along with this library; if not, write to the Free Software
21+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22+
*/
2323

2424
#pragma once
2525

0 commit comments

Comments
 (0)