Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: prepare for release 2.4.0 #1094

Merged
merged 18 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .chglog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It is possible to test the tool by `git-chglog --init` without overriding anythi

## Usage

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

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

## Compare

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

## Manual adjustment

Expand Down
23 changes: 20 additions & 3 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.19
- image: cimg/go:1.22
steps:
- checkout
- run:
Expand All @@ -31,7 +31,7 @@ jobs:

"test_platforms":
docker:
- image: cimg/go:1.19
- image: cimg/go:1.22
steps:
- checkout
- run:
Expand All @@ -45,7 +45,7 @@ jobs:

"check_examples":
docker:
- image: cimg/go:1.19
- image: cimg/go:1.22
steps:
- checkout
- run:
Expand All @@ -59,10 +59,27 @@ jobs:
SOME=$(grep -L 'digispark' $(grep -L 'gocv' ${ALL}))
for e in ${SOME} ; do go vet "${e}" ; done

"fmt_check_examples":
docker:
- image: golangci/golangci-lint:v1.61.0
steps:
- checkout
- run:
name: Debug linter version
command: golangci-lint --version
- run:
# digispark needs libusb, opencv needs opencv
name: Check examples for linter issues (except digispark, opencv)
command: |
ALL=$(grep -l -r --include "*.go" 'build example' ./)
SOME=$(grep -L 'digispark' $(grep -L 'gocv' ${ALL}))
for e in ${SOME} ; do golangci-lint run "${e}" --build-tags example --disable forcetypeassert --disable noctx ; done

workflows:
version: 2
build:
jobs:
- "test_core_and_drivers_with_coverage"
- "test_platforms"
- "check_examples"
- "fmt_check_examples"
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ If this is a new driver or adaptor:
- [ ] I have added an example to see how to setup and use it
- [ ] I have checked or build at least my new example (e.g. by run `make examples_check`)

If this is a Go version update:

- [ ] go.mod to new version updated
- [ ] modules updated (go get -u -t ./...)
- [ ] CI files updated
- [ ] linter setting and linter version (if a newer one exist) updated
- [ ] linter issues fixed or suppressed by config

If this is a PR for release:

- [ ] The PR's target branch is 'hybridgroup:release'
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,28 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.19'
go-version: '1.22'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
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.55.2
version: v1.61.0

# 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)"
# 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"
# Note: exclude arguments, e.g. --exclude-files="my_file", will not affect the "typecheck" linter,
# at least since v1.61.0 - use build tags instead.
#args: --exclude-files="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

# Optional: if set to true then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
47 changes: 25 additions & 22 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,49 +22,43 @@ run:
# By default, it isn't set.
modules-download-mode: readonly

issues:
# Enables skipping of directories:
# - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
# Default: true
skip-dirs-use-default: false
exclude-dirs-use-default: false

# note: examples will be currently omitted by the build tag
skip-dirs:
- platforms/opencv
# note: folders/files can not be excluded from "typecheck" anymore since v1.61.0

linters:
# currently active linters:
#
# 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]
# INFO [lintersdb] Active 67 linters: [asasalint asciicheck bidichk bodyclose canonicalheader containedctx
# contextcheck decorder depguard dogsled dupword durationcheck errcheck errchkjson errorlint fatcontext
# forcetypeassert gci gocheckcompilerdirectives gochecknoinits gochecksumtype gocritic gofmt gofumpt goimports
# gomoddirectives gomodguard goprintffuncname gosec gosimple govet grouper inamedparam ineffassign lll makezero
# mirror misspell mnd musttag nakedret nilerr nilnil noctx nolintlint nonamedreturns nosprintfhostport perfsprint
# prealloc predeclared protogetter reassign revive sloglint spancheck staticcheck tagalign tenv testableexamples
# testifylint thelper tparallel unconvert unparam unused usestdlibvars wastedassign]

enable-all: true

# https://golangci-lint.run/usage/linters/#enabled-by-default
# note: typecheck can not be disabled, it is used to check code compilation
disable:
# deprecated
- deadcode # deprecated
- exhaustivestruct # deprecated
- golint # deprecated
- ifshort # deprecated
- interfacer # deprecated
- maligned # deprecated
- nosnakecase # deprecated
- scopelint # deprecated
- structcheck # deprecated
- varcheck # deprecated
# deprecated:
- exportloopref # Since Go1.22 (loopvar) this linter is no longer relevant. Replaced by copyloopvar
- gomnd # The linter has been renamed. Replaced by mnd.
# not used for this go version: none
# not used for any reason
- err113 # not used (we allow error creation at return statement)
- execinquery # not needed (no sql)
- exhaustive # not used (we allow incomplete usage of enum switch, e.g. with default case)
- forbidigo # not used (we allow print statements)
- ginkgolinter # not needed (enforces standards of using ginkgo and gomega)
- gochecknoglobals # not used (we allow definition of unexposed variables at top level)
- 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)
- 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 @@ -86,9 +80,10 @@ linters:
- goconst # useful (reduce bugs)
- 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
- intrange # introduced with go 1.22, will simplify the range syntax
- maintidx # useful with some tweeks (better understandable code), maybe use instead "gocyclo", "gocognit" , "cyclop"
- mnd # useful with some exclusions for existing code (e.g. mavlink.go)
- nestif # useful (reduce bugs, simplify code, better understandable code)
- nlreturn # more common style, but could become annoying
- stylecheck # useful with some tweaking (e.g. underscores in names should be allowed - we use it for constants retrieved from C/C++)
Expand Down Expand Up @@ -168,6 +163,14 @@ linters-settings:
# Default: false
require-specific: true

perfsprint:
# Optimizes `fmt.Errorf`.
# Default: true
errorf: false
# Optimizes `fmt.Sprintf` with only one argument
# Default: true
sprintf1: false

revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return
Expand Down
69 changes: 57 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,51 @@
# CHANGELOG

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

## [v2.4.0](https://github.com/hybridgroup/gobot/compare/v2.3.0...v2.4.0) (2024-11-05)

### Bebop

* fix concurrent map writes ([#1063](https://github.com/hybridgroup/gobot/issues/1063))

### Ble

* add support for functional options, add tests ([#1059](https://github.com/hybridgroup/gobot/issues/1059))
* introduce in drivers folder ([#1057](https://github.com/hybridgroup/gobot/issues/1057))
* **client:** add scan timout ([#1051](https://github.com/hybridgroup/gobot/issues/1051))
* **module:** update tinygo.org/x/bluetooth to v0.10 and adapt code ([#1084](https://github.com/hybridgroup/gobot/issues/1084))

### Build

* **go, deps:** switch to Go 1.22 and update modules, linter v1.61.0 and adapt code ([#1093](https://github.com/hybridgroup/gobot/issues/1093),[#1092](https://github.com/hybridgroup/gobot/issues/1092))
* **go, deps:** switch to Go 1.20 and update modules ([#1067](https://github.com/hybridgroup/gobot/issues/1067))
* **linter:** update linter to v1.56.1 and fix issues ([#1068](https://github.com/hybridgroup/gobot/issues/1068))

### Doc

* update links to release or tagged branch ([#1069](https://github.com/hybridgroup/gobot/issues/1069))
* **core:** prepare for release v2.4.0

### Examples

* fix missing checks of return values ([#1060](https://github.com/hybridgroup/gobot/issues/1060))

### Gobot

* rename Master to Manager ([#1070](https://github.com/hybridgroup/gobot/issues/1070))

### Megapi

* use serialport adaptor and move driver to drivers/serial ([#1062](https://github.com/hybridgroup/gobot/issues/1062))

### Neurosky

* use serialport adaptor and move driver to drivers/serial ([#1061](https://github.com/hybridgroup/gobot/issues/1061))

### Test

* try to stabilize eventer tests ([#1066](https://github.com/hybridgroup/gobot/issues/1066))
* try to stabilize firmata tests ([#1097](https://github.com/hybridgroup/gobot/issues/1097))

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

Expand Down Expand Up @@ -1183,7 +1228,7 @@

### core

* Add Running() methods for Master and Robot and increase test coverage accordingly
* Add Running() methods for Manager and Robot and increase test coverage accordingly

### sysfs

Expand Down Expand Up @@ -1647,17 +1692,17 @@
### core

* Refactoring to allow 'Metal' development using Gobot packages
* Able to run robots without being part of a Master.
* Able to run robots without being part of a Manager.
* Now running all work in separate goroutines
* Rename internal name of Master type
* Rename internal name of Manager type
* Refactor events to use channels all the way down.
* Eliminate potential race conditions from Events and Every functions
* Add Unsubscribe() to Eventer, now Once() works as expected
* DeleteEvent function added to Eventer interface
* Ranges over event channels instead of using select
* No longer return non-standard slices of errors, instead use hashicorp/go-multierror
* Ensure that all drivers have default names
* Now both Robot and Master operate using AutoRun as expected
* Now both Robot and Manager operate using AutoRun as expected
* Use canonical import domain of gobot.io for all code
* Use time.Sleep unless waiting for a timeout in a select
* Uses time.NewTimer() instead of time.After() to be more efficient
Expand Down Expand Up @@ -2456,7 +2501,7 @@
* Replaced ginkgo/gomega with system testing package
* Refactor gobot/robot/device commands
* Added Event type
* Replaced Master type with Gobot type
* Replaced Manager type with Gobot type
* Every` and `After` now accept `time.Duration`
* Removed reflection helper methods

Expand Down Expand Up @@ -2580,7 +2625,7 @@
* Finalize on SIGINT
* Publish function for driver events
* device test coverage
* master and robot test coverage
* manager and robot test coverage

### Clean

Expand All @@ -2600,7 +2645,7 @@

### Refactor

* robot and master
* robot and manager

### Remove

Expand Down Expand Up @@ -2636,8 +2681,8 @@
* Travis banner to README
* api commands
* POST command
* master example
* robot master
* manager example
* robot manager
* Sphero example
* Digispark to list of supported platforms
* helper functions
Expand Down Expand Up @@ -2737,11 +2782,11 @@

### Rename

* Gobot struct to Master
* Gobot struct to Manager

### Set

* GOMAXPROCS property in GobotMaster
* GOMAXPROCS property in GobotManager

### Skeleton

Expand Down
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ Descriptions for each of these will eventually be provided below.

## General Guidelines

* All active development is in the `dev` branch. New or updated features must be added to the `dev` branch. Hotfixes
will be considered on the `master` branch in situations where it does not alter behavior or features, only fixes a bug.
* All active development is in the `dev` branch. New or updated features must be added to the `dev` branch.
* All patches must be provided under the Apache 2.0 License
* Please use the -S option in git to "sign off" that the commit is your work and you are providing it under the
Apache 2.0 License
Expand Down Expand Up @@ -142,4 +141,4 @@ Gobot is released with a Contributor Code of Conduct. By participating in this p

## Origins

This document is based on the original [io.js contribution guidelines](https://github.com/nodejs/io.js/blob/master/CONTRIBUTING.md)
This document is based on the original [io.js contribution guidelines](https://github.com/nodejs/io.js/blob/main/CONTRIBUTING.md)
Loading
Loading