Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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.5.0":
Example for a new release "v2.6.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_v250
git-chglog --config .chglog/config_gobot.yml --no-case --next-tag v2.5.0 v2.4.0.. > .chglog/chglog_tmp.md
git checkout -b rel/prepare_for_release_v260
git-chglog --config .chglog/config_gobot.yml --no-case --next-tag v2.6.0 v2.5.0.. > .chglog/chglog_tmp.md
```

## Compare

If unsure about any result of running git-chglog, just use:
`git log --since=2024-11-05 --pretty="- %s"`
`git log --since=2025-02-16 --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*|1-wire)(?:\\(([\\w\\$\\.\\,\\-\\*\\s]*)\\))?\\:?\\s(.*)$"
pattern_maps:
- Type
- Scope
Expand Down
8 changes: 4 additions & 4 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.22
- image: cimg/go:1.24
steps:
- checkout
- run:
Expand All @@ -31,7 +31,7 @@ jobs:

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

"check_examples":
docker:
- image: cimg/go:1.22
- image: cimg/go:1.24
steps:
- checkout
- run:
Expand All @@ -61,7 +61,7 @@ jobs:

"fmt_check_examples":
docker:
- image: golangci/golangci-lint:v1.64.5
- image: golangci/golangci-lint:v2.4.0
steps:
- checkout
- run:
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 @@ -22,7 +22,7 @@ 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:
If this is a Go version or module update:

- [ ] go.mod to new version updated
- [ ] modules updated (go get -u -t ./...)
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.24'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v7
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.64.5
version: v2.4.0

# Optional: working directory, useful for monorepos
# working-directory: v2
Expand Down
199 changes: 106 additions & 93 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# note: GolangCI-Lint also searches for config files in all directories from the directory of the first analyzed path up to the root.
version: "2"
run:
build-tags:
- utils
Expand All @@ -22,22 +23,12 @@ 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
exclude-dirs-use-default: false

# note: folders/files can not be excluded from "typecheck" anymore since v1.61.0

linters:
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
linters:
default: all
disable:
# deprecated:
- tenv # replaced by usetesting
# deprecated: none
# not used for this go version: none
# not used for any reason
- err113 # not used (we allow error creation at return statement)
Expand All @@ -51,6 +42,7 @@ linters:
- 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)
- noinlineerr # this violates best practices in other style guides
- paralleltest # not used
- promlinter # not needed (prometheus metrics naming)
- rowserrcheck # not needed (sql related)
Expand All @@ -63,6 +55,7 @@ linters:
- dupl # useful with some tweeks (reduce bugs and lines of code)
- errname # useful for common style
- exhaustruct # useful with some exclusions for existing code (e.g. mavlink/common/common.go)
- funcorder # common style, but too many findings
- funlen # useful with some tweeks (reduce bugs, simplify code, better understandable code)
- gocognit # useful with some tweeks (better understandable code)
- goconst # useful (reduce bugs)
Expand All @@ -74,95 +67,115 @@ linters:
- 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++)
- tagliatelle # maybe useful with some tweaking or excluding
- 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
- wsl_v5 # same as above

exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling

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

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

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

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
gocritic:
disabled-checks:
- assignOp # very opinionated
- appendAssign # mostly used by intention

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
require-explanation: true
# Enable to require nolint directives to mention the specific linter being suppressed.
# Default: false
require-specific: true

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
perfsprint:
# Optimizes `fmt.Errorf`.
# Default: true
errorf: false
# Optimizes `fmt.Sprintf` with only one argument
# Default: true
sprintf1: 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
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return
# disable this rule, because sometimes it has its justification
- name: unexported-return
severity: warning
disabled: 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
require-explanation: true
# Enable to require nolint directives to mention the specific linter being suppressed.
# Default: false
require-specific: true
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports

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

revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return
# disable this rule, because sometimes it has its justification
- name: unexported-return
severity: warning
disabled: true
settings:
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
Loading