Skip to content

Commit ed0c79a

Browse files
authored
Merge pull request #1054 from hybridgroup/dev
release: prepare for release 2.3.0
2 parents bc0332f + 474d553 commit ed0c79a

File tree

436 files changed

+14089
-8683
lines changed

Some content is hidden

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

436 files changed

+14089
-8683
lines changed

.chglog/README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,23 @@ 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.2.0":
11+
Example for a new release "v2.3.0":
1212

1313
```sh
14+
# optional update tool by: go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest
1415
git checkout release
1516
git pull
1617
git fetch --tags
1718
git checkout dev
1819
git pull upstream dev
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
20+
git checkout -b rel/prepare_for_release_v230
21+
git-chglog --config .chglog/config_gobot.yml --no-case --next-tag v2.3.0 v2.2.0.. > .chglog/chglog_tmp.md
2122
```
2223

2324
## Compare
2425

2526
If unsure about any result of running git-chglog, just use:
26-
`git log --since=2023-07-07 --pretty="- %s"`
27+
`git log --since=2023-10-30 --pretty="- %s"`
2728

2829
## Manual adjustment
2930

@@ -43,24 +44,24 @@ An example for the following commits:
4344
* build(style): adjust rule for golangci-lint
4445

4546
```md
46-
### build
47+
### Build
4748

4849
* **style**: adjust rule for golangci-lint
4950

50-
### docs
51+
### Docs
5152

5253
* **core**: usage of Kernel driver
5354

54-
### i2c
55+
### I2c
5556

5657
* **PCF8583**: added
5758

5859

59-
### gpio
60+
### Gpio
6061

6162
* **HD44780**: fix wrong constants
6263

63-
### raspi
64+
### Raspi
6465

6566
* **PWM**: refactor usage
6667

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- run:
2424
name: Core and drivers tests
2525
command: |
26-
go test -v -coverprofile=coverage.txt -covermode=atomic . ./drivers/...
26+
go test -race -v -coverprofile=coverage.txt -covermode=atomic . ./drivers/...
2727
- run:
2828
name: Code coverage
2929
command: |
@@ -41,7 +41,7 @@ jobs:
4141
# digispark needs libusb, opencv needs opencv
4242
name: Platform tests (except digispark and opencv)
4343
command: |
44-
go test -v $(go list ./platforms/... | grep -v platforms/digispark | grep -v platforms/opencv)
44+
go test -race -v $(go list ./platforms/... | grep -v platforms/digispark | grep -v platforms/opencv)
4545
4646
"check_examples":
4747
docker:

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
- [ ] The PR's target branch is 'hybridgroup:dev'
1414
- [ ] I have added tests that prove my fix is effective or that my feature works
15-
- [ ] New and existing unit tests pass locally with my changes (e.g. by run `make test`)
15+
- [ ] New and existing unit tests pass locally with my changes (e.g. by run `make test_race`)
1616
- [ ] No linter errors exist locally (e.g. by run `make fmt_check`)
1717
- [ ] I have performed a self-review of my own code
1818

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
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.54.2
27+
version: v1.55.2
2828

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

.golangci.yml

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# note: GolangCI-Lint also searches for config files in all directories from the directory of the first analyzed path up to the root.
22
run:
3+
build-tags:
4+
- utils
5+
36
# Timeout for analysis, e.g. 30s, 5m.
47
# gobot is very expensive, on a machine with heavy load it takes some minutes
58
# for first run or after empty the cache by 'golangci-lint cache clean'
@@ -31,10 +34,11 @@ run:
3134
linters:
3235
# currently active linters:
3336
#
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]
37+
# INFO [lintersdb] Active 64 linters: [asasalint asciicheck bidichk bodyclose containedctx contextcheck decorder depguard dogsled dupword durationcheck
38+
# errcheck errchkjson errorlint exportloopref forcetypeassert gci gocheckcompilerdirectives gochecknoinits gochecksumtype gocritic gofmt gofumpt goimports
39+
# gomoddirectives gomodguard goprintffuncname gosec gosimple govet grouper inamedparam ineffassign lll makezero mirror misspell musttag nakedret nilerr nilnil
40+
# noctx nolintlint nonamedreturns nosprintfhostport perfsprint prealloc predeclared protogetter reassign revive sloglint staticcheck tagalign tenv
41+
# testableexamples testifylint thelper tparallel unconvert unparam unused usestdlibvars wastedassign]
3842

3943
enable-all: true
4044

@@ -72,39 +76,23 @@ linters:
7276
- testpackage # not needed, we use the same name for test package to have access to unexposed items
7377
- wrapcheck # not needed (we allow errors from interface methods)
7478
- zerologlint # not needed (related to zerolog package)
75-
# important to have
76-
- errorlint # useful (reduce bugs), but suppress the "Use `%w` to format errors" check
77-
- forcetypeassert # useful (reduce bugs)
78-
- nakedret # very useful together with "nonamedreturns" (reduce bugs)
79-
- nonamedreturns # very useful (reduce bugs)
8079
# useful for the future
81-
- bodyclose # maybe useful (reduce bugs), exclusions for tests needed
82-
- containedctx # useful (structs are not for context wrapping)
8380
- cyclop # useful with some tweeks (better understandable code), see also gocyclo
84-
- dogsled # useful with some tweeks (e.g. exclude tests)
8581
- dupl # useful with some tweeks (reduce bugs and lines of code)
86-
- errchkjson # useful (reduce bugs)
8782
- errname # useful for common style
8883
- exhaustruct # useful with some exclusions for existing code (e.g. mavlink/common/common.go)
8984
- funlen # useful with some tweeks (reduce bugs, simplify code, better understandable code)
90-
- gci # useful (improve readability)
9185
- gocognit # useful with some tweeks (better understandable code)
9286
- goconst # useful (reduce bugs)
93-
- gocritic # useful with some exclusions for existing code (e.g. mavlink/common/common.go)
9487
- gocyclo # useful with some tweeks (better understandable code)
9588
- goheader # useful, if we introduce a common header (e.g. for copyright)
9689
- gomnd # useful with some exclusions for existing code (e.g. mavlink.go)
9790
- interfacebloat # useful with some exclusions at usage of external packages
98-
- lll # useful with some exclusions for existing code (e.g. mavlink/common/common.go)
9991
- maintidx # useful with some tweeks (better understandable code), maybe use instead "gocyclo", "gocognit" , "cyclop"
10092
- nestif # useful (reduce bugs, simplify code, better understandable code)
10193
- nlreturn # more common style, but could become annoying
102-
- noctx # maybe good (show used context explicit)
103-
- predeclared # useful (reduce bugs)
10494
- stylecheck # useful with some tweaking (e.g. underscores in names should be allowed - we use it for constants retrieved from C/C++)
10595
- tagliatelle # maybe useful with some tweaking or excluding
106-
- thelper # useful
107-
- usestdlibvars # useful
10896
- varnamelen # maybe useful with some tweaking, but many findings
10997
- whitespace # more common style, but could become annoying
11098
- wsl # more common style, but could become annoying
@@ -142,6 +130,36 @@ linters-settings:
142130
- "and"
143131
- "a"
144132

133+
errorlint:
134+
# Default: true
135+
# %v should be used by default over %w, see https://github.com/uber-go/guide/blob/master/style.md#error-wrapping
136+
errorf: false
137+
# Permit more than 1 %w verb, valid per Go 1.20 (Requires errorf:true)
138+
# Default: true
139+
errorf-multi: false
140+
141+
gci:
142+
# Section configuration to compare against.
143+
# Section names are case-insensitive and may contain parameters in ().
144+
# The default order of sections is `standard > default > custom > blank > dot`,
145+
# If `custom-order` is `true`, it follows the order of `sections` option.
146+
# Default: ["standard", "default"]
147+
sections:
148+
- standard # Standard section: captures all standard packages.
149+
- default # Default section: contains all imports that could not be matched to another section type.
150+
- prefix(gobot.io/x/gobot/) # Custom section: groups all imports with the specified Prefix.
151+
#- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
152+
#- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
153+
# Enable custom order of sections.
154+
# If `true`, make the section order the same as the order of `sections`.
155+
# Default: false
156+
custom-order: true
157+
158+
gocritic:
159+
disabled-checks:
160+
- assignOp # very opinionated
161+
- appendAssign # mostly used by intention
162+
145163
nolintlint:
146164
# Enable to require an explanation of nonzero length after each nolint directive.
147165
# Default: false

CHANGELOG.md

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

3-
## [Unreleased](https://github.com/hybridgroup/gobot/compare/v2.2.0...HEAD)
3+
## [Unreleased](https://github.com/hybridgroup/gobot/compare/v2.3.0...HEAD)
4+
5+
## [v2.3.0](https://github.com/hybridgroup/gobot/compare/v2.2.0...v2.3.0) (2024-01-06)
6+
7+
### Adaptors
8+
9+
* **pwm:** introduce scale option for servo ([#1046](https://github.com/hybridgroup/gobot/issues/1046))
10+
* **analogpins:** add a generic analog pin adaptor ([#1041](https://github.com/hybridgroup/gobot/issues/1041))
11+
12+
### Aio
13+
14+
* fix data race in AnalogSensorDriver ([#1024](https://github.com/hybridgroup/gobot/issues/1024))
15+
* **all:** introduce functional options ([#1039](https://github.com/hybridgroup/gobot/issues/1039))
16+
* **analog sensor:** fix deadlock in cyclic reading ([#1042](https://github.com/hybridgroup/gobot/issues/1042))
17+
* **thermalzone:** add driver for read a thermalzone from system ([#1040](https://github.com/hybridgroup/gobot/issues/1040))
18+
19+
### Build
20+
21+
* **go, deps:** update modules ([#1047](https://github.com/hybridgroup/gobot/issues/1047), [#1052](https://github.com/hybridgroup/gobot/issues/1052))
22+
23+
### Doc
24+
25+
* **test:** use -race for tests by default ([#1035](https://github.com/hybridgroup/gobot/issues/1035))
26+
27+
### Gpio
28+
29+
* fix data race in StepperDriver ([#1029](https://github.com/hybridgroup/gobot/issues/1029))
30+
* fix data race in PIRMotionDriver ([#1028](https://github.com/hybridgroup/gobot/issues/1028))
31+
* fix data race in ButtonDriver ([#1027](https://github.com/hybridgroup/gobot/issues/1027))
32+
* fix data race in EasyDriver ([#1025](https://github.com/hybridgroup/gobot/issues/1025))
33+
* **all:** introduce functional options ([#1045](https://github.com/hybridgroup/gobot/issues/1045))
34+
35+
### I2c
36+
37+
* **core:** fix problems with usage of uintptr ([#1033](https://github.com/hybridgroup/gobot/issues/1033))
38+
39+
### Lint
40+
41+
* **all:** fix issues of errorlint etc ([#1037](https://github.com/hybridgroup/gobot/issues/1037))
42+
* **all:** switch to 1.55.2 and adjust linter issues ([#1036](https://github.com/hybridgroup/gobot/issues/1036))
43+
44+
### Ollie
45+
46+
* **test:** fix data race in test ([#1034](https://github.com/hybridgroup/gobot/issues/1034))
47+
48+
### Raspi
49+
50+
* **pwm:** add support for sysfs and fix pi-blaster ([#1048](https://github.com/hybridgroup/gobot/issues/1048))
451

552
## [v2.2.0](https://github.com/hybridgroup/gobot/compare/v2.1.1...v2.2.0) (2023-10-29)
653

CONTRIBUTING.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Descriptions for each of these will eventually be provided below.
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)
4444
* `gofumpt` your code (the go version will be automatically obtained from go.mod), see [instructions](https://github.com/mvdan/gofumpt/blob/master/README.md)
45-
* Add unit tests for any new or changed functionality.
45+
* Add unit tests for any new or changed functionality and run tests with `-race` flag activated.
4646
* All pull requests should be "fast forward"
4747
* If there are commits after yours use “git rebase -i <new_head_branch>”
4848
* If you have local changes you may need to use “git stash”
@@ -69,14 +69,10 @@ The basics are as follows:
6969
All import paths should now work fine assuming that you've got the
7070
proper branch checked out.
7171

72-
3. Get all the needed gobot's dependencies each of them at their needed version. Gobot uses
73-
[dep (Dependency management for Go)](https://golang.github.io/dep/) to manage the project's dependencies. To get all
74-
the correct dependencies:
72+
3. Get all dependencies:
7573

76-
* Install dep tool. Follow the dep [installation](https://golang.github.io/dep/docs/installation.html) instructions in
77-
case you don't have it already installed.
7874
* `cd $GOPATH/src/gobot.io/x/gobot`
79-
* `dep ensure` will fetch all the dependencies at their needed version.
75+
* `go mod tidy` will fetch all the dependencies at their needed version.
8076

8177
## Landing Pull Requests
8278

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ EXAMPLES := $(EXAMPLES_NO_GOCV)
1010
# opencv platform currently skipped to prevent install of preconditions
1111
including_except := $(shell go list ./... | grep -v platforms/opencv)
1212

13+
# Run tests on nearly all directories without test cache, with race detection
14+
test_race:
15+
go test -failfast -count=1 -v -race $(including_except)
16+
1317
# Run tests on nearly all directories without test cache
1418
test:
15-
go test -failfast -count=1 -v $(including_except)
16-
17-
# Run tests with race detection
18-
test_race:
19-
go test -race $(including_except)
19+
go test -failfast -count=1 $(including_except)
2020

2121
# Test, generate and show coverage in browser
2222
test_cover:
@@ -58,6 +58,7 @@ fmt_check:
5858
fmt_fix:
5959
$(MAKE) version_check || true
6060
gofumpt -l -w .
61+
golangci-lint run -v --fix
6162

6263
examples: $(EXAMPLES)
6364

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,16 @@ a shared set of drivers provided using the `gobot/drivers/gpio` package:
275275
- Buzzer
276276
- Direct Pin
277277
- EasyDriver
278-
- Grove Button
279-
- Grove Buzzer
280-
- Grove LED
281-
- Grove Magnetic Switch
282-
- Grove Relay
283-
- Grove Touch Sensor
278+
- Grove Button (by using driver for Button)
279+
- Grove Buzzer (by using driver for Buzzer)
280+
- Grove LED (by using driver for LED)
281+
- Grove Magnetic Switch (by using driver for Button)
282+
- Grove Relay (by using driver for Relay)
283+
- Grove Touch Sensor (by using driver for Button)
284284
- HC-SR04 Ultrasonic Ranging Module
285285
- HD44780 LCD controller
286286
- LED
287-
- Makey Button
287+
- Makey Button (by using driver for Button)
288288
- MAX7219 LED Dot Matrix
289289
- Motor
290290
- Proximity Infra Red (PIR) Motion Sensor
@@ -298,12 +298,15 @@ Support for many devices that use Analog Input/Output (AIO) have
298298
a shared set of drivers provided using the `gobot/drivers/aio` package:
299299

300300
- [AIO](https://en.wikipedia.org/wiki/Analog-to-digital_converter) <=> [Drivers](https://github.com/hybridgroup/gobot/tree/master/drivers/aio)
301+
- Analog Actuator
301302
- Analog Sensor
302303
- Grove Light Sensor
303304
- Grove Piezo Vibration Sensor
304305
- Grove Rotary Dial
305306
- Grove Sound Sensor
306307
- Grove Temperature Sensor
308+
- Temperature Sensor (supports linear and NTC thermistor in normal and inverse mode)
309+
- Thermal Zone Temperature Sensor
307310

308311
Support for devices that use Inter-Integrated Circuit (I2C) have a shared set of
309312
drivers provided using the `gobot/drivers/i2c` package:

0 commit comments

Comments
 (0)