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

code for release 2.1.1 #972

Merged
merged 43 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
865e724
Build(v2): revert move to v2 subfolder (#932)
gen2thomas May 29, 2023
2fa53fe
build(deps): bump github.com/eclipse/paho.mqtt.golang
dependabot[bot] May 29, 2023
8e0a894
build(deps): bump github.com/warthog618/gpiod from 0.8.0 to 0.8.1
dependabot[bot] May 29, 2023
6df2801
build(deps): bump github.com/warthog618/gpiod from 0.8.0 to 0.8.1
gen2thomas May 29, 2023
645f5bf
build(deps): bump github.com/eclipse/paho.mqtt.golang from 1.4.1 to 1…
gen2thomas May 29, 2023
3ddd456
build(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.3
dependabot[bot] May 29, 2023
a5e9d86
build(deps): bump go.bug.st/serial from 1.4.0 to 1.5.0
dependabot[bot] May 29, 2023
30903b1
build(deps): bump go.bug.st/serial from 1.4.0 to 1.5.0
gen2thomas May 29, 2023
03fd872
build(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.3
gen2thomas May 29, 2023
ac849e7
Build(go, deps): switch to Go 1.18 and update modules (#940)
gen2thomas Jun 4, 2023
0d0a508
core(build): CLI removed (#946)
gen2thomas Jun 4, 2023
8b20c45
all: substitute deprecated ioutil methods (#923)
dlstjq7685 Jun 10, 2023
d9061ce
tello: Fix partially #793 by initialize doneCh in NewDriverWithIP (#931)
joeyberkovitz Jun 11, 2023
f5d8d5c
all(style) : fix linter issues for errcheck, ineffassign, unused and …
gen2thomas Jun 12, 2023
875d972
tello: fix wifiMessage and lightMessage (#957)
gen2thomas Jun 14, 2023
314a808
ble: simplify and substitute errors.Wrap() (#958)
gen2thomas Jun 14, 2023
10dabf1
mavlink: fix linter issues of errcheck (#959)
gen2thomas Jun 14, 2023
09d85d6
core: upgrade modules (#961)
gen2thomas Jun 18, 2023
1e2a4d8
build(linters): list of linter todo's (#962)
gen2thomas Jun 18, 2023
ad12eac
system(syscall): switch to x/sys (#963)
gen2thomas Jun 19, 2023
91b7d07
build(linter): fix makezero linter issue (#965)
gen2thomas Jun 20, 2023
e3e2e88
doc: adjust README.md regarding to your first project (#970)
gen2thomas Jul 6, 2023
914e2ea
build(deps): module update (#971)
gen2thomas Jul 6, 2023
ca2e38a
build(deps): bump github.com/warthog618/gpiod from 0.8.0 to 0.8.1
dependabot[bot] May 29, 2023
b493cf5
build(deps): bump github.com/eclipse/paho.mqtt.golang
dependabot[bot] May 29, 2023
24043c9
build(deps): bump go.bug.st/serial from 1.4.0 to 1.5.0
dependabot[bot] May 29, 2023
91d9cb6
build(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.3
dependabot[bot] May 29, 2023
2b18516
Build(go, deps): switch to Go 1.18 and update modules (#940)
gen2thomas Jun 4, 2023
d94ed68
core(build): CLI removed (#946)
gen2thomas Jun 4, 2023
1175db3
all: substitute deprecated ioutil methods (#923)
dlstjq7685 Jun 10, 2023
d459fc0
tello: Fix partially #793 by initialize doneCh in NewDriverWithIP (#931)
joeyberkovitz Jun 11, 2023
712a213
all(style) : fix linter issues for errcheck, ineffassign, unused and …
gen2thomas Jun 12, 2023
e807156
tello: fix wifiMessage and lightMessage (#957)
gen2thomas Jun 14, 2023
70b8f31
ble: simplify and substitute errors.Wrap() (#958)
gen2thomas Jun 14, 2023
33e906b
mavlink: fix linter issues of errcheck (#959)
gen2thomas Jun 14, 2023
a2e06b8
core: upgrade modules (#961)
gen2thomas Jun 18, 2023
0648f66
build(linters): list of linter todo's (#962)
gen2thomas Jun 18, 2023
bc3d7d4
system(syscall): switch to x/sys (#963)
gen2thomas Jun 19, 2023
a6d6571
build(linter): fix makezero linter issue (#965)
gen2thomas Jun 20, 2023
b0ee8b9
doc: adjust README.md regarding to your first project (#970)
gen2thomas Jul 6, 2023
f928903
build(deps): module update (#971)
gen2thomas Jul 6, 2023
70c6d29
all: fix dev branch by rebase to prepare release (#973)
gen2thomas Jul 6, 2023
bf4c15d
all: fix dev branch by rebase to prepare release, no squash
gen2thomas Jul 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 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.17
- image: cimg/go:1.18
steps:
- checkout
- run:
Expand All @@ -31,7 +31,7 @@ jobs:

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

"check_examples":
docker:
- image: cimg/go:1.17
- image: cimg/go:1.18
steps:
- checkout
- run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: '1.17'
go-version: '1.18'
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.52.2
version: v1.53.3

# Optional: working directory, useful for monorepos
# working-directory: v2
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.sass-cache
*.test
*.swp
*.snap
profile.cov
count.out
*.swp
*.snap
/parts
/prime
/stage
vendor/
output/
.idea/
coverage.txt
.chglog/chglog_tmp*.md
Expand Down
118 changes: 107 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,118 @@ run:
- platforms/opencv

linters:
# Enable specific linter
# 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]

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
#
# TODO: this default linters needs to be disabled to run successfully, we have to fix
# all issues step by step to enable at least the default linters
disable:
- errcheck
- ineffassign
#- staticcheck
- unused

enable:
- nolintlint
# deprecated
- deadcode # deprecated
- exhaustivestruct # deprecated
- golint # deprecated
- ifshort # deprecated
- interfacer # deprecated
- maligned # deprecated
- nosnakecase # deprecated
- scopelint # deprecated
- structcheck # deprecated
- varcheck # deprecated
# not used for any reason
- 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)
- 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)
- loggercheck # not needed (relates to kitlog, klog, logr, zap)
- paralleltest # not used
- promlinter # not needed (prometheus metrics naming)
- rowserrcheck # not needed (sql related)
- sqlclosecheck # not needed (sql related)
- 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
- gofmt # important to prevent "format tsunami" ("gofmt -s -w" missed), disabled due to "https://github.com/golangci/golangci-lint-action/issues/535"
- 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)
- 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

linters-settings:
depguard:
# Rules to apply.
#
# Variables:
# - File Variables
# you can still use and exclamation mark ! in front of a variable to say not to use it.
# Example !$test will match any file that is not a go test file.
#
# `$all` - matches all go files
# `$test` - matches all go test files
#
# - Package Variables
#
# `$gostd` - matches all of go's standard library (Pulled from `GOROOT`)
#
# Default: Only allow $gostd in all files.
rules:
main:
# Packages that are not allowed where the value is a suggestion.
deny:
- pkg: "github.com/pkg/errors"
desc: Should be replaced by standard lib errors package

nolintlint:
# Enable to require an explanation of nonzero length after each nolint directive.
# Default: false
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Descriptions for each of these will eventually be provided below.
* 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”
* For git help see [progit](http://git-scm.com/book) which is an awesome (and free) book on git
* Use one of the latest existing platforms/drivers etc. as a blueprint for creating a new one

## Creating Pull Requests

Expand All @@ -58,9 +59,9 @@ The basics are as follows:

1. Fork the project via the GitHub UI

2. `go get` the upstream repo and set it up as the `upstream` remote and your own repo as the `origin` remote:
2. `git clone` the upstream repo and set it up as the `upstream` remote and your own repo as the `origin` remote:

`go get gobot.io/x/gobot/v2`
`git clone https://github.com/hybridgroup/gobot.git`
`cd $GOPATH/src/gobot.io/x/gobot`
`git remote rename origin upstream`
`git remote add origin git@github.com/YOUR_GITHUB_NAME/gobot`
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ including_except := $(shell go list ./... | grep -v platforms/opencv)

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

# Run tests with race detection
test_race:
Expand Down Expand Up @@ -56,12 +56,12 @@ version_check:

# Check for bad code style and other issues
fmt_check:
gofmt -l ./
gofmt -l -s .
golangci-lint run -v

# Fix bad code style (will only be executed, on version match)
fmt_fix: version_check
go fmt ./...
gofmt -l -s -w .

examples: $(EXAMPLES)

Expand Down
Loading