Skip to content

Commit

Permalink
Merge pull request #1023 from hybridgroup/dev
Browse files Browse the repository at this point in the history
release: prepare for release 2.2.0
  • Loading branch information
gen2thomas authored Oct 30, 2023
2 parents ba8136f + 24f0645 commit bc0332f
Show file tree
Hide file tree
Showing 389 changed files with 8,908 additions and 6,888 deletions.
8 changes: 4 additions & 4 deletions .chglog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ It is possible to test the tool by `git-chglog --init` without overriding anythi

## Usage

Example for a new release "v2.1.1":
Example for a new release "v2.2.0":

```sh
git checkout release
git pull
git fetch --tags
git checkout dev
git pull upstream dev
git checkout -b rel/prepare_for_release_v211
git-chglog --config .chglog/config_gobot.yml --no-case --next-tag v2.1.1 v2.1.0.. > .chglog/chglog_tmp.md
git checkout -b rel/prepare_for_release_v220
git-chglog --config .chglog/config_gobot.yml --no-case --next-tag v2.2.0 v2.1.1.. > .chglog/chglog_tmp.md
```

## Compare

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

## Manual adjustment

Expand Down
2 changes: 1 addition & 1 deletion .chglog/config_gobot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ info:
repository_url: https://github.com/hybridgroup/gobot
options:
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:?\\s(.*)$"
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\,\\-\\*\\s]*)\\))?\\:?\\s(.*)$"
pattern_maps:
- Type
- Scope
Expand Down
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ version: 2
jobs:
"test_core_and_drivers_with_coverage":
docker:
- image: cimg/go:1.18
- image: cimg/go:1.19
steps:
- checkout
- run:
Expand All @@ -31,32 +31,32 @@ jobs:
"test_platforms":
docker:
- image: cimg/go:1.18
- image: cimg/go:1.19
steps:
- checkout
- run:
name: Debug version
command: go version
- run:
# digispark needs libusb, joystick needs sdl2, opencv needs opencv
name: Platform tests (except digispark, joystick, opencv)
# digispark needs libusb, opencv needs opencv
name: Platform tests (except digispark and opencv)
command: |
go test -v $(go list ./platforms/... | grep -v platforms/digispark | grep -v platforms/joystick | grep -v platforms/opencv)
go test -v $(go list ./platforms/... | grep -v platforms/digispark | grep -v platforms/opencv)
"check_examples":
docker:
- image: cimg/go:1.18
- image: cimg/go:1.19
steps:
- checkout
- run:
name: Debug version
command: go version
- run:
# digispark needs libusb, joystick needs sdl2, opencv needs opencv
name: Check examples (except digispark, joystick, opencv)
# digispark needs libusb, opencv needs opencv
name: Check examples (except digispark, opencv)
command: |
ALL=$(grep -l -r --include "*.go" 'build example' ./)
SOME=$(grep -L 'digispark' $(grep -L 'joystick' $(grep -L 'gocv' ${ALL})))
SOME=$(grep -L 'digispark' $(grep -L 'gocv' ${ALL}))
for e in ${SOME} ; do go vet "${e}" ; done
workflows:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.18'
go-version: '1.19'
cache: false
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.53.3
version: v1.54.2

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

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

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
Expand Down
29 changes: 15 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ run:
linters:
# currently active linters:
#
#INFO [lintersdb] Active 35 linters: [asasalint asciicheck bidichk contextcheck decorder depguard durationcheck errcheck exportloopref
# gocheckcompilerdirectives gomoddirectives gomodguard goprintffuncname gosimple govet grouper ineffassign makezero mirror musttag
# nilerr nilnil nolintlint nosprintfhostport prealloc reassign revive staticcheck tagalign tenv testableexamples tparallel typecheck unused wastedassign]
#INFO [lintersdb] Active 42 linters: [asasalint asciicheck bidichk contextcheck decorder depguard dupword durationcheck errcheck exportloopref
# gocheckcompilerdirectives gofmt gofumpt goimports gomoddirectives gomodguard goprintffuncname gosec gosimple govet grouper ineffassign makezero mirror
# misspell musttag nilerr nilnil nolintlint nosprintfhostport prealloc reassign revive staticcheck tagalign tenv testableexamples tparallel unconvert unparam
# unused wastedassign]

enable-all: true

Expand All @@ -60,7 +61,6 @@ linters:
- godot # not used (seems to be counting peas)
- godox # not used (we have many TODOs, so not useful)
- goerr113 # not used (we allow error creation at return statement)
- gofumpt # not used (we use "go fmt" or "gofmt" not gofumpt"
- gosmopolitan # not needed (report i18n/l10n anti-patterns)
- importas # not needed (there is no alias rule at the moment)
- ireturn # not used (we allow return interfaces)
Expand All @@ -73,38 +73,30 @@ linters:
- wrapcheck # not needed (we allow errors from interface methods)
- zerologlint # not needed (related to zerolog package)
# important to have
- gofmt # important to prevent "format tsunami" ("gofmt -s -w" missed), disabled due to "https://github.com/golangci/golangci-lint-action/issues/535"
- errorlint # useful (reduce bugs), but suppress the "Use `%w` to format errors" check
- forcetypeassert # useful (reduce bugs)
- nakedret # very useful together with "nonamedreturns" (reduce bugs)
- nonamedreturns # very useful (reduce bugs)
- unconvert # very useful (reduce bugs, simplify code)
- unparam # very useful (reduce bugs, simplify code)
# useful for the future
- bodyclose # maybe useful (reduce bugs), exclusions for tests needed
- containedctx # useful (structs are not for context wrapping)
- cyclop # useful with some tweeks (better understandable code), see also gocyclo
- dogsled # useful with some tweeks (e.g. exclude tests)
- dupl # useful with some tweeks (reduce bugs and lines of code)
- dupword # useful with some tweeks, but not important
- errchkjson # useful (reduce bugs)
- errname # useful for common style
- errorlint # useful (reduce bugs), but suppress the "Use `%w` to format errors" check
- exhaustruct # useful with some exclusions for existing code (e.g. mavlink/common/common.go)
- forcetypeassert # useful (reduce bugs)
- funlen # useful with some tweeks (reduce bugs, simplify code, better understandable code)
- gci # useful (improve readability)
- gochecknoinits # useful (reduce bugs, simplify bug catching)
- gocognit # useful with some tweeks (better understandable code)
- goconst # useful (reduce bugs)
- gocritic # useful with some exclusions for existing code (e.g. mavlink/common/common.go)
- gocyclo # useful with some tweeks (better understandable code)
- goheader # useful, if we introduce a common header (e.g. for copyright)
- goimports # useful (common style), but not important
- gomnd # useful with some exclusions for existing code (e.g. mavlink.go)
- gosec # useful (security)
- interfacebloat # useful with some exclusions at usage of external packages
- lll # useful with some exclusions for existing code (e.g. mavlink/common/common.go)
- maintidx # useful with some tweeks (better understandable code), maybe use instead "gocyclo", "gocognit" , "cyclop"
- misspell # useful (better understandable code), but not important
- nestif # useful (reduce bugs, simplify code, better understandable code)
- nlreturn # more common style, but could become annoying
- noctx # maybe good (show used context explicit)
Expand Down Expand Up @@ -141,6 +133,15 @@ linters-settings:
- pkg: "github.com/pkg/errors"
desc: Should be replaced by standard lib errors package

dupword:
# Keywords for detecting duplicate words.
# If this list is not empty, only the words defined in this list will be detected.
# Default: []
keywords:
- "the"
- "and"
- "a"

nolintlint:
# Enable to require an explanation of nonzero length after each nolint directive.
# Default: false
Expand Down
57 changes: 56 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,61 @@
# CHANGELOG

## [Unreleased](https://github.com/hybridgroup/gobot/compare/v2.1.1...HEAD)
## [Unreleased](https://github.com/hybridgroup/gobot/compare/v2.2.0...HEAD)

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

### Adaptors

* **PWM:** fix wrong duty cycle after kill program ([#994](https://github.com/hybridgroup/gobot/issues/994))

### Beaglebone

* **doc:** fix preceding typo ([#985](https://github.com/hybridgroup/gobot/issues/985))

### Build

* **deps:** module update ([#992](https://github.com/hybridgroup/gobot/issues/992))
* **go, deps:** switch to Go 1.19 and update modules ([#1008](https://github.com/hybridgroup/gobot/issues/1008))
* **style:** switch to gofumpt and add linters ([#1009](https://github.com/hybridgroup/gobot/issues/1009))

### Doc

* **roadmap:** remove file ROADMAP.md after creating issues ([#1005](https://github.com/hybridgroup/gobot/issues/1005))

### Dragonboard

* fix example and documentation ([#977](https://github.com/hybridgroup/gobot/issues/977))

### Gpio

* **hcsr04:** add driver for ultrasonic ranging module ([#1012](https://github.com/hybridgroup/gobot/issues/1012))

### I2c

* **PCA9685, adafruit, adafruit2327, adafruit2348:** clean up architecture and fix init ([#1021](https://github.com/hybridgroup/gobot/issues/1021))

### Jetson

* **PWM:** fix set period ([#1019](https://github.com/hybridgroup/gobot/issues/1019))

### Joystick

* **core:** replace sdl with 0xcafed00d/joystick package ([#988](https://github.com/hybridgroup/gobot/issues/988))

### Sphero

* Add support for calibration

### System

* **gpio:** add edge polling function ([#1015](https://github.com/hybridgroup/gobot/issues/1015))

### Test

* **all:** substitude assert.Nil by assert.NoError if useful ([#1016](https://github.com/hybridgroup/gobot/issues/1016))
* **all:** substitude assert.Error by assert.ErrorContains ([#1014](https://github.com/hybridgroup/gobot/issues/1014), [#1011](https://github.com/hybridgroup/gobot/issues/1011))
* **all:** switch to test package stretchr testify ([#1006](https://github.com/hybridgroup/gobot/issues/1006))
* **gpio, aio:** cleanup helper_test ([#1018](https://github.com/hybridgroup/gobot/issues/1018))

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

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Descriptions for each of these will eventually be provided below.
from time to time but they can complicate merges and should be done separately.
* Take care to maintain the existing coding style.
* `golangci-lint` your code, see [instruction for local installation](https://golangci-lint.run/usage/install/#local-installation)
* `go fmt` your code (with the go version of go.mod)
* `gofumpt` your code (the go version will be automatically obtained from go.mod), see [instructions](https://github.com/mvdan/gofumpt/blob/master/README.md)
* Add unit tests for any new or changed functionality.
* All pull requests should be "fast forward"
* If there are commits after yours use “git rebase -i <new_head_branch>”
Expand Down
16 changes: 6 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
ALL_EXAMPLES := $(shell grep -l -r --include "*.go" 'build example' ./)
# prevent examples with gocv (opencv) dependencies
EXAMPLES_NO_GOCV := $(shell grep -L 'gocv' $(ALL_EXAMPLES))
# prevent examples with joystick (sdl2) dependencies
EXAMPLES_NO_JOYSTICK := $(shell grep -L 'joystick' $(ALL_EXAMPLES))
# prevent examples with joystick (sdl2) and gocv (opencv) dependencies
EXAMPLES_NO_GOCV_JOYSTICK := $(shell grep -L 'joystick' $$(grep -L 'gocv' $(EXAMPLES_NO_GOCV)))
# used examples
EXAMPLES := $(EXAMPLES_NO_GOCV_JOYSTICK)
EXAMPLES := $(EXAMPLES_NO_GOCV)

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

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

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

# Fix bad code style (will only be executed, on version match)
fmt_fix: version_check
gofmt -l -s -w .
# Fix bad code style (the go version will be automatically obtained from go.mod)
fmt_fix:
$(MAKE) version_check || true
gofumpt -l -w .

examples: $(EXAMPLES)

Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Support for many devices that use General Purpose Input/Output (GPIO) have
a shared set of drivers provided using the `gobot/drivers/gpio` package:

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

- [I2C](https://en.wikipedia.org/wiki/I%C2%B2C) <=> [Drivers](https://github.com/hybridgroup/gobot/tree/master/drivers/i2c)
- Adafruit 2x16 RGB-LCD with 5 keys
- Adafruit Motor Hat
- Adafruit 1109 2x16 RGB-LCD with 5 keys
- Adafruit 2327 16-Channel PWM/Servo HAT Hat
- Adafruit 2348 DC and Stepper Motor Hat
- ADS1015 Analog to Digital Converter
- ADS1115 Analog to Digital Converter
- ADXL345 Digital Accelerometer
Expand Down
56 changes: 0 additions & 56 deletions ROADMAP.md

This file was deleted.

Loading

0 comments on commit bc0332f

Please sign in to comment.