Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Default configuration for all files
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

# Use utf-8 charset for modern languages
[*.{go}]
charset = utf-8

# Use tab indentation for Go and Makefiles
[{*.go,go.*}]
indent_style = tab
indent_size = 4

1 change: 0 additions & 1 deletion .github/workflows/go-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ jobs:
run: |
go mod tidy
git diff --color --exit-code

8 changes: 2 additions & 6 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
pull_request:
branches: [main]

env:
GO_VERSION: "1.25.1"

# In the same branch only 1 workflow per time can run. In case we're not in the
# main branch we cancel previous running workflow
concurrency:
Expand All @@ -25,8 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Run tests
run: go test -v --race ./...

run: go tool task test
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- "*" # Trigger on all tags

env:
GO_VERSION: "1.25.1"
PROJECT_NAME: "remoteocd"
GITHUB_TOKEN: ${{ secrets.ARDUINOBOT_TOKEN }}
GITHUB_USERNAME: ArduinoBot
Expand Down Expand Up @@ -47,7 +46,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version-file: go.mod

- name: Build Binary
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
.bin/

# Mac system files
.DS_Store
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Flexible firmware flashing for the Arduino UNO Q Microcontroller.

`remoteocd` is a specialized utility designed to manage firmware deployment for the Arduino UNO Q board.
This tool acts as a versatile wrapper for OpenOCD (Open On-Chip Debugger), allowing you to flash a binary onto the MCU using one of three transparently handled modes:

- Local, by flashing from the UNO Q's MPU (Linux) environment.
- ADB over USB.
- SSH over a remote pc.
Expand Down
46 changes: 46 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,58 @@
version: "3"

vars:
GOLANGCI_LINT_VERSION: v2.4.0
GOIMPORTS_VERSION: v0.29.0
DPRINT_VERSION: 0.48.0

tasks:
init:
desc: Setup local env
deps:
- install:linter
- install:goimports
- install:dprint

install:linter:
cmds:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b .bin/ {{ .GOLANGCI_LINT_VERSION }}

install:goimports:
cmds:
- go install golang.org/x/tools/cmd/goimports@{{ .GOIMPORTS_VERSION }}

install:dprint:
cmds:
- curl -fsSL https://dprint.dev/install.sh | sh -s {{ .DPRINT_VERSION }}
- mkdir -p .bin && cp $HOME/.dprint/bin/dprint .bin/dprint # workaround for local install

go:add-license-headers:
desc: Add missing go license headers
cmds:
- go install github.com/google/[email protected]
- addlicense -c "ARDUINO SA (http://www.arduino.cc/)" -f ./license_header.tpl $(find . -name "*.go" -type f -print0 | xargs -0)

test:
desc: Run go tests
cmds:
- go test ./... -v -race {{ .CLI_ARGS }}

lint:
desc: Run the linters
cmds:
- ${PWD}/.bin/golangci-lint run --fix -v --timeout 300s {{ .CLI_ARGS }}

fmt:
desc: Run format
cmds:
- goimports -l -w .
- ${PWD}/.bin/dprint fmt

fmt-check:
desc: Check format
cmds:
- ${PWD}/.bin/dprint check

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies-task/Taskfile.yml
general:cache-dep-licenses:
desc: Cache dependency license metadata
Expand Down
11 changes: 11 additions & 0 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"markdown": {},
"yaml": {},
"excludes": [
".licenses/**"
],
"plugins": [
"https://plugins.dprint.dev/markdown-0.17.8.wasm",
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm"
]
}