Skip to content

Releases: ashanbrown/forbidigo

v1.6.0

04 Jul 14:31
ab8eef6
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.5.4...v1.6.0

v1.5.4

03 Jul 02:02
f6adf99
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.5.3...v1.5.4

Slight change to handling of missing type information

11 Jun 18:12
c506b28
Compare
Choose a tag to compare
Refactor package name extraction slightly (#36)

Rename one method and handle case where some type information is missing slightly better.

Ensure that types within a selector are matched

11 Jun 17:39
fbbca18
Compare
Choose a tag to compare
Ensure we match types within a selector (#35)

Also refactor expansion code slightly

Remove deprecated pkg/errors package

25 Feb 14:28
2a92cc5
Compare
Choose a tag to compare
Remove deprecated pkg errors (#28)

Replace github.com/pkg/errors with native error handling

pkg/errors has been deprecated since go1.13.
Let's also set go1.13 as the new minimum.

---------

Co-authored-by: Oleksandr Redko <[email protected]>

Require a configuration option to expand type info

25 Feb 14:04
7298305
Compare
Choose a tag to compare
Require an option to be set on analyzer to expand type info (#27)

Because type expansion is a bit experimental and to avoid letting the presence of TypesInfo in the config control the analyzer behavior, let's require a new option to enable analyzing types.

Match patterns against canonical object name instead of source text

13 Feb 01:49
1396000
Compare
Choose a tag to compare

This release adds a new matching engine based that matches rules on the canonical name of a package attribute or function instead of raw text as it appears in the source code. It also adds support for a mode where a rule is matched based on the canonical name of a type or interface (see the current README for details). This latter mode requires loading type information from dependencies, which could slow down analysis for things like pre-commit hooks, so it is currently disabled by default. Thanks to @pohly for proposing this change, and for the months he put in to implement it in a way that we hope will cause minimal disruption to existing rules. There are some cases where this may new matching engine may break existing behavior, but we believe the number of such cases will be minimal and have chosen not to consider this a major version release. The release also allows scoping a rule to match from a particular package using a regex.

v1.3.0: Support custom forbid reason messages (#11)

12 Jan 16:23
9d87656
Compare
Choose a tag to compare
In order to allow users to communicate intent to collaborators,
optionally embed custom messages into each forbidden pattern.

The syntax is as follows: `identifier(# message goes here)?`

Example: `^fmt\.Errorf(# Please don't use this!)?$`

Regular expressions containing custom messages are effectively identical
to ones that don't, because the sub-expression containing it is marked
optional with a `?`. All this commit does is parse out any recognized
custom message, and place it prominently in the tool's output. The
regular expression itself is omitted from the tool's output when a
custom message is specified.

Ignore print/println by default. Standardize //permit directives.

10 May 22:59
f30240a
Compare
Choose a tag to compare
v1.2.0

Add print and println to default exclusions list (#7)

v1.1.0: Exclude godoc examples by default (#4)

31 Jan 16:52
60920e1
Compare
Choose a tag to compare
godoc examples (https://blog.golang.org/examples) depend on being able to write to stdout, which is in contradiction to the default forbidden pattern of fmt.Print*. To make this work nicely out of the box, we will skip checking godoc examples by default. This includes "whole file examples", in which an entire file is ignored because it has only a single Example* method.

This PR also allows the //permit directive to be ignored, allowing this linter to be controlled just using the standard //nolint directive from golangci lint.

This PR also adds a dependency on the launchdarkly/go-options option code generator, which isn't pinned in the repo. I may consider doing that at a later date.

Fixes #3