Skip to content

Commit

Permalink
Merge pull request #1054 from hybridgroup/dev
Browse files Browse the repository at this point in the history
release: prepare for release 2.3.0
  • Loading branch information
gen2thomas committed Jan 7, 2024
2 parents bc0332f + 474d553 commit ed0c79a
Show file tree
Hide file tree
Showing 436 changed files with 14,089 additions and 8,683 deletions.
19 changes: 10 additions & 9 deletions .chglog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,23 @@ It is possible to test the tool by `git-chglog --init` without overriding anythi

## Usage

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

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

## Compare

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

## Manual adjustment

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

```md
### build
### Build

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

### docs
### Docs

* **core**: usage of Kernel driver

### i2c
### I2c

* **PCF8583**: added


### gpio
### Gpio

* **HD44780**: fix wrong constants

### raspi
### Raspi

* **PWM**: refactor usage

Expand Down
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- run:
name: Core and drivers tests
command: |
go test -v -coverprofile=coverage.txt -covermode=atomic . ./drivers/...
go test -race -v -coverprofile=coverage.txt -covermode=atomic . ./drivers/...
- run:
name: Code coverage
command: |
Expand All @@ -41,7 +41,7 @@ jobs:
# 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/opencv)
go test -race -v $(go list ./platforms/... | grep -v platforms/digispark | grep -v platforms/opencv)
"check_examples":
docker:
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
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.54.2
version: v1.55.2

# Optional: working directory, useful for monorepos
# working-directory: v2
Expand Down
58 changes: 38 additions & 20 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# note: GolangCI-Lint also searches for config files in all directories from the directory of the first analyzed path up to the root.
run:
build-tags:
- utils

# Timeout for analysis, e.g. 30s, 5m.
# gobot is very expensive, on a machine with heavy load it takes some minutes
# for first run or after empty the cache by 'golangci-lint cache clean'
Expand Down Expand Up @@ -31,10 +34,11 @@ run:
linters:
# currently active linters:
#
#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]
# INFO [lintersdb] Active 64 linters: [asasalint asciicheck bidichk bodyclose containedctx contextcheck decorder depguard dogsled dupword durationcheck
# errcheck errchkjson errorlint exportloopref forcetypeassert gci gocheckcompilerdirectives gochecknoinits gochecksumtype gocritic gofmt gofumpt goimports
# gomoddirectives gomodguard goprintffuncname gosec gosimple govet grouper inamedparam ineffassign lll makezero mirror misspell musttag nakedret nilerr nilnil
# noctx nolintlint nonamedreturns nosprintfhostport perfsprint prealloc predeclared protogetter reassign revive sloglint staticcheck tagalign tenv
# testableexamples testifylint thelper tparallel unconvert unparam unused usestdlibvars wastedassign]

enable-all: true

Expand Down Expand Up @@ -72,39 +76,23 @@ linters:
- testpackage # not needed, we use the same name for test package to have access to unexposed items
- wrapcheck # not needed (we allow errors from interface methods)
- zerologlint # not needed (related to zerolog package)
# important to have
- 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)
# 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)
- errchkjson # useful (reduce bugs)
- errname # useful for common style
- exhaustruct # useful with some exclusions for existing code (e.g. mavlink/common/common.go)
- funlen # useful with some tweeks (reduce bugs, simplify code, better understandable code)
- gci # useful (improve readability)
- 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)
- gomnd # useful with some exclusions for existing code (e.g. mavlink.go)
- 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"
- nestif # useful (reduce bugs, simplify code, better understandable code)
- nlreturn # more common style, but could become annoying
- noctx # maybe good (show used context explicit)
- predeclared # useful (reduce bugs)
- stylecheck # useful with some tweaking (e.g. underscores in names should be allowed - we use it for constants retrieved from C/C++)
- tagliatelle # maybe useful with some tweaking or excluding
- thelper # useful
- usestdlibvars # useful
- varnamelen # maybe useful with some tweaking, but many findings
- whitespace # more common style, but could become annoying
- wsl # more common style, but could become annoying
Expand Down Expand Up @@ -142,6 +130,36 @@ linters-settings:
- "and"
- "a"

errorlint:
# Default: true
# %v should be used by default over %w, see https://github.com/uber-go/guide/blob/master/style.md#error-wrapping
errorf: false
# Permit more than 1 %w verb, valid per Go 1.20 (Requires errorf:true)
# Default: true
errorf-multi: false

gci:
# Section configuration to compare against.
# Section names are case-insensitive and may contain parameters in ().
# The default order of sections is `standard > default > custom > blank > dot`,
# If `custom-order` is `true`, it follows the order of `sections` option.
# Default: ["standard", "default"]
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(gobot.io/x/gobot/) # Custom section: groups all imports with the specified Prefix.
#- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
#- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
# Enable custom order of sections.
# If `true`, make the section order the same as the order of `sections`.
# Default: false
custom-order: true

gocritic:
disabled-checks:
- assignOp # very opinionated
- appendAssign # mostly used by intention

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

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

## [v2.3.0](https://github.com/hybridgroup/gobot/compare/v2.2.0...v2.3.0) (2024-01-06)

### Adaptors

* **pwm:** introduce scale option for servo ([#1046](https://github.com/hybridgroup/gobot/issues/1046))
* **analogpins:** add a generic analog pin adaptor ([#1041](https://github.com/hybridgroup/gobot/issues/1041))

### Aio

* fix data race in AnalogSensorDriver ([#1024](https://github.com/hybridgroup/gobot/issues/1024))
* **all:** introduce functional options ([#1039](https://github.com/hybridgroup/gobot/issues/1039))
* **analog sensor:** fix deadlock in cyclic reading ([#1042](https://github.com/hybridgroup/gobot/issues/1042))
* **thermalzone:** add driver for read a thermalzone from system ([#1040](https://github.com/hybridgroup/gobot/issues/1040))

### Build

* **go, deps:** update modules ([#1047](https://github.com/hybridgroup/gobot/issues/1047), [#1052](https://github.com/hybridgroup/gobot/issues/1052))

### Doc

* **test:** use -race for tests by default ([#1035](https://github.com/hybridgroup/gobot/issues/1035))

### Gpio

* fix data race in StepperDriver ([#1029](https://github.com/hybridgroup/gobot/issues/1029))
* fix data race in PIRMotionDriver ([#1028](https://github.com/hybridgroup/gobot/issues/1028))
* fix data race in ButtonDriver ([#1027](https://github.com/hybridgroup/gobot/issues/1027))
* fix data race in EasyDriver ([#1025](https://github.com/hybridgroup/gobot/issues/1025))
* **all:** introduce functional options ([#1045](https://github.com/hybridgroup/gobot/issues/1045))

### I2c

* **core:** fix problems with usage of uintptr ([#1033](https://github.com/hybridgroup/gobot/issues/1033))

### Lint

* **all:** fix issues of errorlint etc ([#1037](https://github.com/hybridgroup/gobot/issues/1037))
* **all:** switch to 1.55.2 and adjust linter issues ([#1036](https://github.com/hybridgroup/gobot/issues/1036))

### Ollie

* **test:** fix data race in test ([#1034](https://github.com/hybridgroup/gobot/issues/1034))

### Raspi

* **pwm:** add support for sysfs and fix pi-blaster ([#1048](https://github.com/hybridgroup/gobot/issues/1048))

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

Expand Down
10 changes: 3 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Descriptions for each of these will eventually be provided below.
* 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)
* `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.
* Add unit tests for any new or changed functionality and run tests with `-race` flag activated.
* All pull requests should be "fast forward"
* If there are commits after yours use “git rebase -i <new_head_branch>”
* If you have local changes you may need to use “git stash”
Expand All @@ -69,14 +69,10 @@ The basics are as follows:
All import paths should now work fine assuming that you've got the
proper branch checked out.

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

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

## Landing Pull Requests

Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ EXAMPLES := $(EXAMPLES_NO_GOCV)
# opencv platform currently skipped to prevent install of preconditions
including_except := $(shell go list ./... | grep -v platforms/opencv)

# Run tests on nearly all directories without test cache, with race detection
test_race:
go test -failfast -count=1 -v -race $(including_except)

# Run tests on nearly all directories without test cache
test:
go test -failfast -count=1 -v $(including_except)

# Run tests with race detection
test_race:
go test -race $(including_except)
go test -failfast -count=1 $(including_except)

# Test, generate and show coverage in browser
test_cover:
Expand Down Expand Up @@ -58,6 +58,7 @@ fmt_check:
fmt_fix:
$(MAKE) version_check || true
gofumpt -l -w .
golangci-lint run -v --fix

examples: $(EXAMPLES)

Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,16 @@ a shared set of drivers provided using the `gobot/drivers/gpio` package:
- Buzzer
- Direct Pin
- EasyDriver
- Grove Button
- Grove Buzzer
- Grove LED
- Grove Magnetic Switch
- Grove Relay
- Grove Touch Sensor
- Grove Button (by using driver for Button)
- Grove Buzzer (by using driver for Buzzer)
- Grove LED (by using driver for LED)
- Grove Magnetic Switch (by using driver for Button)
- Grove Relay (by using driver for Relay)
- Grove Touch Sensor (by using driver for Button)
- HC-SR04 Ultrasonic Ranging Module
- HD44780 LCD controller
- LED
- Makey Button
- Makey Button (by using driver for Button)
- MAX7219 LED Dot Matrix
- Motor
- Proximity Infra Red (PIR) Motion Sensor
Expand All @@ -298,12 +298,15 @@ Support for many devices that use Analog Input/Output (AIO) have
a shared set of drivers provided using the `gobot/drivers/aio` package:

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

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

0 comments on commit ed0c79a

Please sign in to comment.