From 3153120120148b3dc65a7d2451fe385291d90fcb Mon Sep 17 00:00:00 2001 From: Jonathan Haylett Date: Mon, 31 Jul 2023 10:23:41 +0000 Subject: [PATCH 1/6] build: add devcontainer.json --- .devcontainer/devcontainer.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..a6c954f1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,16 @@ +{ + "name": "HayBox", + "image": "mcr.microsoft.com/devcontainers/universal:2-linux", + "features": {}, + "onCreateCommand": "python -m pip install -U platformio && pio pkg install && pio pkg update -g -p https://github.com/maxgerhardt/platform-raspberrypi", + "customizations": { + "vscode": { + "settings": {}, + "extensions": [ + "ms-vscode.cpptools", + "platformio.platformio-ide", + "xaver.clang-format" + ] + } + } +} \ No newline at end of file From 4bafa2ee2e730739c3fe002dd7007558ad8dbd2b Mon Sep 17 00:00:00 2001 From: Jonathan Haylett Date: Mon, 31 Jul 2023 10:53:38 +0000 Subject: [PATCH 2/6] build: add clang-format --- .devcontainer/devcontainer.json | 6 +++++- .vscode/settings.json | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a6c954f1..7bda69b7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,11 @@ { "name": "HayBox", "image": "mcr.microsoft.com/devcontainers/universal:2-linux", - "features": {}, + "features": { + "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { + "packages": "clang-format" + } + }, "onCreateCommand": "python -m pip install -U platformio && pio pkg install && pio pkg update -g -p https://github.com/maxgerhardt/platform-raspberrypi", "customizations": { "vscode": { diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..1dac57f1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "editor.defaultFormatter": "xaver.clang-format", + "editor.formatOnSave": true +} \ No newline at end of file From ce745ee1c9b9dcb4e7ec9520eb360f0120192908 Mon Sep 17 00:00:00 2001 From: Jonathan Haylett Date: Mon, 31 Jul 2023 11:11:40 +0000 Subject: [PATCH 3/6] build: use debian base image for dev container --- .devcontainer/devcontainer.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7bda69b7..bfb03d7f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "HayBox", - "image": "mcr.microsoft.com/devcontainers/universal:2-linux", + "image": "mcr.microsoft.com/devcontainers/base:debian", "features": { "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { "packages": "clang-format" @@ -9,7 +9,10 @@ "onCreateCommand": "python -m pip install -U platformio && pio pkg install && pio pkg update -g -p https://github.com/maxgerhardt/platform-raspberrypi", "customizations": { "vscode": { - "settings": {}, + "settings": { + "workbench.colorTheme": "Default Dark+", + "git.autofetch": true + }, "extensions": [ "ms-vscode.cpptools", "platformio.platformio-ide", From cba77b45b7a451de62527569d24bdcc1d26e172e Mon Sep 17 00:00:00 2001 From: Jonathan Haylett Date: Mon, 31 Jul 2023 14:14:58 +0000 Subject: [PATCH 4/6] build: switch to Ubuntu 22.04 as base image --- .devcontainer/devcontainer.json | 6 +++--- .vscode/settings.json | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bfb03d7f..92c179a2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,12 @@ { "name": "HayBox", - "image": "mcr.microsoft.com/devcontainers/base:debian", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04", "features": { "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { - "packages": "clang-format" + "packages": "python3-pip,python3-venv,clang-format-14" } }, - "onCreateCommand": "python -m pip install -U platformio && pio pkg install && pio pkg update -g -p https://github.com/maxgerhardt/platform-raspberrypi", + "onCreateCommand": "python3 -m pip install -U platformio && pio pkg install && pio pkg update -g -p https://github.com/maxgerhardt/platform-raspberrypi", "customizations": { "vscode": { "settings": { diff --git a/.vscode/settings.json b/.vscode/settings.json index 1dac57f1..88170ff0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { "editor.defaultFormatter": "xaver.clang-format", + "clang-format.executable": "clang-format-14", "editor.formatOnSave": true } \ No newline at end of file From 81b2cc0f115c159a04815f504e0a44a6b18c36bd Mon Sep 17 00:00:00 2001 From: Jonathan Haylett Date: Mon, 31 Jul 2023 15:23:11 +0100 Subject: [PATCH 5/6] build: move clang-format stuff from settings.json to devcontainer.json in case people running it locally don't have clang-format installed --- .devcontainer/devcontainer.json | 5 ++++- .vscode/settings.json | 5 ----- 2 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 92c179a2..59931604 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,7 +11,10 @@ "vscode": { "settings": { "workbench.colorTheme": "Default Dark+", - "git.autofetch": true + "git.autofetch": true, + "editor.defaultFormatter": "xaver.clang-format", + "clang-format.executable": "clang-format-14", + "editor.formatOnSave": true }, "extensions": [ "ms-vscode.cpptools", diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 88170ff0..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "editor.defaultFormatter": "xaver.clang-format", - "clang-format.executable": "clang-format-14", - "editor.formatOnSave": true -} \ No newline at end of file From ece0798afc4d58af91c76f0bc5e4d46a5f449ffe Mon Sep 17 00:00:00 2001 From: Jonathan Haylett Date: Mon, 31 Jul 2023 15:26:38 +0100 Subject: [PATCH 6/6] style: replace tabs with spaces --- .devcontainer/devcontainer.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 59931604..9ac69999 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,12 @@ { - "name": "HayBox", - "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04", + "name": "HayBox", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04", "features": { - "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { - "packages": "python3-pip,python3-venv,clang-format-14" - } - }, - "onCreateCommand": "python3 -m pip install -U platformio && pio pkg install && pio pkg update -g -p https://github.com/maxgerhardt/platform-raspberrypi", + "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { + "packages": "python3-pip,python3-venv,clang-format-14" + } + }, + "onCreateCommand": "python3 -m pip install -U platformio && pio pkg install && pio pkg update -g -p https://github.com/maxgerhardt/platform-raspberrypi", "customizations": { "vscode": { "settings": {