Skip to content

Commit bc0332f

Browse files
authored
Merge pull request #1023 from hybridgroup/dev
release: prepare for release 2.2.0
2 parents ba8136f + 24f0645 commit bc0332f

File tree

389 files changed

+8908
-6888
lines changed

Some content is hidden

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

389 files changed

+8908
-6888
lines changed

.chglog/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ It is possible to test the tool by `git-chglog --init` without overriding anythi
88

99
## Usage
1010

11-
Example for a new release "v2.1.1":
11+
Example for a new release "v2.2.0":
1212

1313
```sh
1414
git checkout release
1515
git pull
1616
git fetch --tags
1717
git checkout dev
1818
git pull upstream dev
19-
git checkout -b rel/prepare_for_release_v211
20-
git-chglog --config .chglog/config_gobot.yml --no-case --next-tag v2.1.1 v2.1.0.. > .chglog/chglog_tmp.md
19+
git checkout -b rel/prepare_for_release_v220
20+
git-chglog --config .chglog/config_gobot.yml --no-case --next-tag v2.2.0 v2.1.1.. > .chglog/chglog_tmp.md
2121
```
2222

2323
## Compare
2424

2525
If unsure about any result of running git-chglog, just use:
26-
`git log --since=2023-05-28 --pretty="- %s"`
26+
`git log --since=2023-07-07 --pretty="- %s"`
2727

2828
## Manual adjustment
2929

.chglog/config_gobot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ info:
55
repository_url: https://github.com/hybridgroup/gobot
66
options:
77
header:
8-
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:?\\s(.*)$"
8+
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\,\\-\\*\\s]*)\\))?\\:?\\s(.*)$"
99
pattern_maps:
1010
- Type
1111
- Scope

.circleci/config.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ version: 2
1414
jobs:
1515
"test_core_and_drivers_with_coverage":
1616
docker:
17-
- image: cimg/go:1.18
17+
- image: cimg/go:1.19
1818
steps:
1919
- checkout
2020
- run:
@@ -31,32 +31,32 @@ jobs:
3131
3232
"test_platforms":
3333
docker:
34-
- image: cimg/go:1.18
34+
- image: cimg/go:1.19
3535
steps:
3636
- checkout
3737
- run:
3838
name: Debug version
3939
command: go version
4040
- run:
41-
# digispark needs libusb, joystick needs sdl2, opencv needs opencv
42-
name: Platform tests (except digispark, joystick, opencv)
41+
# digispark needs libusb, opencv needs opencv
42+
name: Platform tests (except digispark and opencv)
4343
command: |
44-
go test -v $(go list ./platforms/... | grep -v platforms/digispark | grep -v platforms/joystick | grep -v platforms/opencv)
44+
go test -v $(go list ./platforms/... | grep -v platforms/digispark | grep -v platforms/opencv)
4545
4646
"check_examples":
4747
docker:
48-
- image: cimg/go:1.18
48+
- image: cimg/go:1.19
4949
steps:
5050
- checkout
5151
- run:
5252
name: Debug version
5353
command: go version
5454
- run:
55-
# digispark needs libusb, joystick needs sdl2, opencv needs opencv
56-
name: Check examples (except digispark, joystick, opencv)
55+
# digispark needs libusb, opencv needs opencv
56+
name: Check examples (except digispark, opencv)
5757
command: |
5858
ALL=$(grep -l -r --include "*.go" 'build example' ./)
59-
SOME=$(grep -L 'digispark' $(grep -L 'joystick' $(grep -L 'gocv' ${ALL})))
59+
SOME=$(grep -L 'digispark' $(grep -L 'gocv' ${ALL}))
6060
for e in ${SOME} ; do go vet "${e}" ; done
6161
6262
workflows:

.github/workflows/golangci-lint.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,24 @@ jobs:
1515
name: lint
1616
runs-on: ubuntu-latest
1717
steps:
18+
- uses: actions/checkout@v3
1819
- uses: actions/setup-go@v4
1920
with:
20-
go-version: '1.18'
21+
go-version: '1.19'
2122
cache: false
22-
- uses: actions/checkout@v3
2323
- name: golangci-lint
2424
uses: golangci/golangci-lint-action@v3
2525
with:
2626
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
27-
version: v1.53.3
27+
version: v1.54.2
2828

2929
# Optional: working directory, useful for monorepos
3030
# working-directory: v2
3131

3232
# Optional: golangci-lint command line arguments.
3333
# mostly there is no problem locally, but on server: "could not import C (cgo preprocessing failed) (typecheck)"
34-
args: --skip-files platforms/digispark/littleWire.go
34+
# and the digispark adaptor can not be build since switch to linter version 1.54.2
35+
args: --skip-files="platforms/digispark/littleWire.go,platforms/digispark/digispark_adaptor.go"
3536

3637
# Optional: show only new issues if it's a pull request. The default value is `false`.
3738
# only-new-issues: true

.golangci.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ run:
3131
linters:
3232
# currently active linters:
3333
#
34-
#INFO [lintersdb] Active 35 linters: [asasalint asciicheck bidichk contextcheck decorder depguard durationcheck errcheck exportloopref
35-
# gocheckcompilerdirectives gomoddirectives gomodguard goprintffuncname gosimple govet grouper ineffassign makezero mirror musttag
36-
# nilerr nilnil nolintlint nosprintfhostport prealloc reassign revive staticcheck tagalign tenv testableexamples tparallel typecheck unused wastedassign]
34+
#INFO [lintersdb] Active 42 linters: [asasalint asciicheck bidichk contextcheck decorder depguard dupword durationcheck errcheck exportloopref
35+
# gocheckcompilerdirectives gofmt gofumpt goimports gomoddirectives gomodguard goprintffuncname gosec gosimple govet grouper ineffassign makezero mirror
36+
# misspell musttag nilerr nilnil nolintlint nosprintfhostport prealloc reassign revive staticcheck tagalign tenv testableexamples tparallel unconvert unparam
37+
# unused wastedassign]
3738

3839
enable-all: true
3940

@@ -60,7 +61,6 @@ linters:
6061
- godot # not used (seems to be counting peas)
6162
- godox # not used (we have many TODOs, so not useful)
6263
- goerr113 # not used (we allow error creation at return statement)
63-
- gofumpt # not used (we use "go fmt" or "gofmt" not gofumpt"
6464
- gosmopolitan # not needed (report i18n/l10n anti-patterns)
6565
- importas # not needed (there is no alias rule at the moment)
6666
- ireturn # not used (we allow return interfaces)
@@ -73,38 +73,30 @@ linters:
7373
- wrapcheck # not needed (we allow errors from interface methods)
7474
- zerologlint # not needed (related to zerolog package)
7575
# important to have
76-
- gofmt # important to prevent "format tsunami" ("gofmt -s -w" missed), disabled due to "https://github.com/golangci/golangci-lint-action/issues/535"
76+
- errorlint # useful (reduce bugs), but suppress the "Use `%w` to format errors" check
77+
- forcetypeassert # useful (reduce bugs)
7778
- nakedret # very useful together with "nonamedreturns" (reduce bugs)
7879
- nonamedreturns # very useful (reduce bugs)
79-
- unconvert # very useful (reduce bugs, simplify code)
80-
- unparam # very useful (reduce bugs, simplify code)
8180
# useful for the future
8281
- bodyclose # maybe useful (reduce bugs), exclusions for tests needed
8382
- containedctx # useful (structs are not for context wrapping)
8483
- cyclop # useful with some tweeks (better understandable code), see also gocyclo
8584
- dogsled # useful with some tweeks (e.g. exclude tests)
8685
- dupl # useful with some tweeks (reduce bugs and lines of code)
87-
- dupword # useful with some tweeks, but not important
8886
- errchkjson # useful (reduce bugs)
8987
- errname # useful for common style
90-
- errorlint # useful (reduce bugs), but suppress the "Use `%w` to format errors" check
9188
- exhaustruct # useful with some exclusions for existing code (e.g. mavlink/common/common.go)
92-
- forcetypeassert # useful (reduce bugs)
9389
- funlen # useful with some tweeks (reduce bugs, simplify code, better understandable code)
9490
- gci # useful (improve readability)
95-
- gochecknoinits # useful (reduce bugs, simplify bug catching)
9691
- gocognit # useful with some tweeks (better understandable code)
9792
- goconst # useful (reduce bugs)
9893
- gocritic # useful with some exclusions for existing code (e.g. mavlink/common/common.go)
9994
- gocyclo # useful with some tweeks (better understandable code)
10095
- goheader # useful, if we introduce a common header (e.g. for copyright)
101-
- goimports # useful (common style), but not important
10296
- gomnd # useful with some exclusions for existing code (e.g. mavlink.go)
103-
- gosec # useful (security)
10497
- interfacebloat # useful with some exclusions at usage of external packages
10598
- lll # useful with some exclusions for existing code (e.g. mavlink/common/common.go)
10699
- maintidx # useful with some tweeks (better understandable code), maybe use instead "gocyclo", "gocognit" , "cyclop"
107-
- misspell # useful (better understandable code), but not important
108100
- nestif # useful (reduce bugs, simplify code, better understandable code)
109101
- nlreturn # more common style, but could become annoying
110102
- noctx # maybe good (show used context explicit)
@@ -141,6 +133,15 @@ linters-settings:
141133
- pkg: "github.com/pkg/errors"
142134
desc: Should be replaced by standard lib errors package
143135

136+
dupword:
137+
# Keywords for detecting duplicate words.
138+
# If this list is not empty, only the words defined in this list will be detected.
139+
# Default: []
140+
keywords:
141+
- "the"
142+
- "and"
143+
- "a"
144+
144145
nolintlint:
145146
# Enable to require an explanation of nonzero length after each nolint directive.
146147
# Default: false

CHANGELOG.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,61 @@
11
# CHANGELOG
22

3-
## [Unreleased](https://github.com/hybridgroup/gobot/compare/v2.1.1...HEAD)
3+
## [Unreleased](https://github.com/hybridgroup/gobot/compare/v2.2.0...HEAD)
4+
5+
## [v2.2.0](https://github.com/hybridgroup/gobot/compare/v2.1.1...v2.2.0) (2023-10-29)
6+
7+
### Adaptors
8+
9+
* **PWM:** fix wrong duty cycle after kill program ([#994](https://github.com/hybridgroup/gobot/issues/994))
10+
11+
### Beaglebone
12+
13+
* **doc:** fix preceding typo ([#985](https://github.com/hybridgroup/gobot/issues/985))
14+
15+
### Build
16+
17+
* **deps:** module update ([#992](https://github.com/hybridgroup/gobot/issues/992))
18+
* **go, deps:** switch to Go 1.19 and update modules ([#1008](https://github.com/hybridgroup/gobot/issues/1008))
19+
* **style:** switch to gofumpt and add linters ([#1009](https://github.com/hybridgroup/gobot/issues/1009))
20+
21+
### Doc
22+
23+
* **roadmap:** remove file ROADMAP.md after creating issues ([#1005](https://github.com/hybridgroup/gobot/issues/1005))
24+
25+
### Dragonboard
26+
27+
* fix example and documentation ([#977](https://github.com/hybridgroup/gobot/issues/977))
28+
29+
### Gpio
30+
31+
* **hcsr04:** add driver for ultrasonic ranging module ([#1012](https://github.com/hybridgroup/gobot/issues/1012))
32+
33+
### I2c
34+
35+
* **PCA9685, adafruit, adafruit2327, adafruit2348:** clean up architecture and fix init ([#1021](https://github.com/hybridgroup/gobot/issues/1021))
36+
37+
### Jetson
38+
39+
* **PWM:** fix set period ([#1019](https://github.com/hybridgroup/gobot/issues/1019))
40+
41+
### Joystick
42+
43+
* **core:** replace sdl with 0xcafed00d/joystick package ([#988](https://github.com/hybridgroup/gobot/issues/988))
44+
45+
### Sphero
46+
47+
* Add support for calibration
48+
49+
### System
50+
51+
* **gpio:** add edge polling function ([#1015](https://github.com/hybridgroup/gobot/issues/1015))
52+
53+
### Test
54+
55+
* **all:** substitude assert.Nil by assert.NoError if useful ([#1016](https://github.com/hybridgroup/gobot/issues/1016))
56+
* **all:** substitude assert.Error by assert.ErrorContains ([#1014](https://github.com/hybridgroup/gobot/issues/1014), [#1011](https://github.com/hybridgroup/gobot/issues/1011))
57+
* **all:** switch to test package stretchr testify ([#1006](https://github.com/hybridgroup/gobot/issues/1006))
58+
* **gpio, aio:** cleanup helper_test ([#1018](https://github.com/hybridgroup/gobot/issues/1018))
459

560
## [v2.1.1](https://github.com/hybridgroup/gobot/compare/v2.1.0...v2.1.1) (2023-07-07)
661

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Descriptions for each of these will eventually be provided below.
4141
from time to time but they can complicate merges and should be done separately.
4242
* Take care to maintain the existing coding style.
4343
* `golangci-lint` your code, see [instruction for local installation](https://golangci-lint.run/usage/install/#local-installation)
44-
* `go fmt` your code (with the go version of go.mod)
44+
* `gofumpt` your code (the go version will be automatically obtained from go.mod), see [instructions](https://github.com/mvdan/gofumpt/blob/master/README.md)
4545
* Add unit tests for any new or changed functionality.
4646
* All pull requests should be "fast forward"
4747
* If there are commits after yours use “git rebase -i <new_head_branch>”

Makefile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
ALL_EXAMPLES := $(shell grep -l -r --include "*.go" 'build example' ./)
33
# prevent examples with gocv (opencv) dependencies
44
EXAMPLES_NO_GOCV := $(shell grep -L 'gocv' $(ALL_EXAMPLES))
5-
# prevent examples with joystick (sdl2) dependencies
6-
EXAMPLES_NO_JOYSTICK := $(shell grep -L 'joystick' $(ALL_EXAMPLES))
7-
# prevent examples with joystick (sdl2) and gocv (opencv) dependencies
8-
EXAMPLES_NO_GOCV_JOYSTICK := $(shell grep -L 'joystick' $$(grep -L 'gocv' $(EXAMPLES_NO_GOCV)))
95
# used examples
10-
EXAMPLES := $(EXAMPLES_NO_GOCV_JOYSTICK)
6+
EXAMPLES := $(EXAMPLES_NO_GOCV)
117

128
.PHONY: test test_race test_cover robeaux version_check fmt_check fmt_fix examples examples_check $(EXAMPLES)
139

@@ -54,14 +50,14 @@ version_check:
5450
echo "go: $${gv}.*, go.mod: $${mv}" ; \
5551
if [ "$${gv}" != "$${mv}" ]; then exit 50; fi ; \
5652

57-
# Check for bad code style and other issues
53+
# Check for bad code style and other issues (gofumpt and gofmt check is activated for the linter)
5854
fmt_check:
59-
gofmt -l -s .
6055
golangci-lint run -v
6156

62-
# Fix bad code style (will only be executed, on version match)
63-
fmt_fix: version_check
64-
gofmt -l -s -w .
57+
# Fix bad code style (the go version will be automatically obtained from go.mod)
58+
fmt_fix:
59+
$(MAKE) version_check || true
60+
gofumpt -l -w .
6561

6662
examples: $(EXAMPLES)
6763

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ Support for many devices that use General Purpose Input/Output (GPIO) have
270270
a shared set of drivers provided using the `gobot/drivers/gpio` package:
271271

272272
- [GPIO](https://en.wikipedia.org/wiki/General_Purpose_Input/Output) <=> [Drivers](https://github.com/hybridgroup/gobot/tree/master/drivers/gpio)
273-
- AIP1640 LED
273+
- AIP1640 LED Dot Matrix/7 Segment Controller
274274
- Button
275275
- Buzzer
276276
- Direct Pin
@@ -281,8 +281,11 @@ a shared set of drivers provided using the `gobot/drivers/gpio` package:
281281
- Grove Magnetic Switch
282282
- Grove Relay
283283
- Grove Touch Sensor
284+
- HC-SR04 Ultrasonic Ranging Module
285+
- HD44780 LCD controller
284286
- LED
285287
- Makey Button
288+
- MAX7219 LED Dot Matrix
286289
- Motor
287290
- Proximity Infra Red (PIR) Motion Sensor
288291
- Relay
@@ -306,8 +309,9 @@ Support for devices that use Inter-Integrated Circuit (I2C) have a shared set of
306309
drivers provided using the `gobot/drivers/i2c` package:
307310

308311
- [I2C](https://en.wikipedia.org/wiki/I%C2%B2C) <=> [Drivers](https://github.com/hybridgroup/gobot/tree/master/drivers/i2c)
309-
- Adafruit 2x16 RGB-LCD with 5 keys
310-
- Adafruit Motor Hat
312+
- Adafruit 1109 2x16 RGB-LCD with 5 keys
313+
- Adafruit 2327 16-Channel PWM/Servo HAT Hat
314+
- Adafruit 2348 DC and Stepper Motor Hat
311315
- ADS1015 Analog to Digital Converter
312316
- ADS1115 Analog to Digital Converter
313317
- ADXL345 Digital Accelerometer

ROADMAP.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)