go-ruleguard

Define and run pattern-based custom linting rules.

BSD-3-CLAUSE License

Stars
784
Committers
28

Bot releases are visible (Hide)

go-ruleguard - v0.3.6

Published by github-actions[bot] over 3 years ago

Changes

  • internal/gogrep: allow f($*_) to match variadic calls @quasilyte (#239)
  • ruleguard: handle variadic vars in filters properly @quasilyte (#238)
  • ruleguard/typematch: add interface{$*_} pattern support @quasilyte (#236)
  • ruleguard: implement Var.Line filter @quasilyte (#234)
  • dsl: add Var.Line field @quasilyte (#233)
go-ruleguard - v0.3.5

Published by github-actions[bot] over 3 years ago

Changes

  • cmd/gorules: add DocNote field @quasilyte (#231)
  • ruleguard: add DocNote field @quasilyte (#230)
  • cmd/gorules: initial commit @quasilyte (#229)
  • ruleguard: add Engine.LoadedGroups method @quasilyte (#228)
  • ruleguard: add support for structured doc comments @quasilyte (#227)
  • analyzer/testdata: fix emptyStringTest rule for gocritic @quasilyte (#226)
  • gogrep: improve FieldList matching inside func types @quasilyte (#225)
go-ruleguard - v0.3.4

Published by github-actions[bot] over 3 years ago

Changes

  • ruleguard: implement MatchComment function from the DSL @quasilyte (#223)
  • dsl: add MatchComment method to the DSL module @quasilyte (#222)
go-ruleguard - v0.3.3

Published by github-actions[bot] over 3 years ago

Changes

  • a complete gogrep rewrite @quasilyte (#221)
  • ruleguard: use parseError.error field for the returned error @quasilyte (#220)
go-ruleguard - v0.3.2

Published by github-actions[bot] over 3 years ago

Changes

  • Change %v to %w so we can call Unwrap @sebastien-rosset (#217)
  • fix typo @sebastien-rosset (#216)
  • Fix filename @AlekSi (#218)
go-ruleguard - v0.3.1

Published by github-actions[bot] over 3 years ago

Changes

Highlights:

  • added more package imports caching
  • started gogrep matching engine rewriting
  • added non-strict literal matching

Bug fixes

  • gogrep: save and restore wildcard positions during $* backtracking @quasilyte (#211)

DSL

  • dsl/types: add types.Array and types.Slice @quasilyte (#213)
  • ruleguard: allow FQN in Implements() filter @quasilyte (#187)

Performance

  • ruleguard: add loaded package deps to cache @quasilyte (#194)
  • gogrep: don't copy capture slice during backtracking @quasilyte (#210)
  • gogrep: use slices instead of maps for capture data @quasilyte (#209)

Rules

  • rules: add emptyError rule @quasilyte (#208)

Dev

  • all: improve test coverage, update dsl package to v0.3.1 @quasilyte (#214)
  • makefile: use "./..." everywhere + use coverpkg for coverage profiles @quasilyte (#212)
  • gogrep: add more tests @quasilyte (#206)
  • gogrep: rewrite matching code @quasilyte (#205)
  • gogrep: remove unused *types.Info field from the matcher @quasilyte (#204)
  • gogrep: simplify expr/stmt list matching @quasilyte (#203)
  • gogrep: encode varInfo into the ast.Ident directly @quasilyte (#202)
  • gogrep: use different parsing func in tests @quasilyte (#201)
  • gogrep: add more capture tests @quasilyte (#200)
  • gogrep: add capture tests @quasilyte (#199)
  • gogrep: update gogrep code (from upstream) + rewrite tests @quasilyte (#198)
  • gogrep: remove unused code @quasilyte (#197)
  • ruleguard/quasigo: fix flaky NoAllocs test @quasilyte (#196)
  • analyzer: reduce metachar escaping in want regexps by using \Q @mlevesquedion (#195)
  • update the dsl package dependency version @quasilyte (#190)
  • analyzer: don't print "e: " prefix in -e mode @quasilyte (#189)
  • ruleguard: fix nil engine state for bundles @quasilyte (#185)
  • ruleguard/quasigo: improve "bad ret type" error message @quasilyte (#186)
go-ruleguard - v0.3.0

Published by github-actions[bot] almost 4 years ago

Changes

Summary:

  • Custom filters support (see examples)
  • Debug modes (-debug-group, -debug-filter, ...)
  • Ruleguard bundles

Bug fixes

  • ruleguard: fix interpolation of vars with common prefix @quasilyte (#123)
  • ruleguard: set GoRuleInfo fields before passing it to Report() @quasilyte (#147)
  • ruleguard: use alternative types.Implements() implementation @quasilyte (#161)

DSL

  • dsl: add experimental API related to the custom filters @quasilyte (#171)
  • ruleguard: allow Var.Value.Int() and Var.Text as RHS @quasilyte (#126)
  • ruleguard,dsl: add Var.Node filters @quasilyte (#124)
  • dsl: add a bundle sketch @quasilyte (#145)
  • all: forbid unnamed rule groups func _() @quasilyte (#148)
  • all: rename "dsl/fluent" to just "dsl" @quasilyte (#151)
  • add custom filter functions initial support @quasilyte (#173)

CLI

  • ruleguard: filter parsing improvements @quasilyte (#142)
  • analyzer: add -enable and -disable flags @quasilyte (#164)
  • ruleguard,analyzer: add -debug-imports flag @quasilyte (#163)
  • analyzer: add optional version info (only when built with Make) @quasilyte (#180)

Rules

  • add bad defer unlock @cristaloleg (#131)
  • add redundant len check @cristaloleg (#132)

Docs

  • move docs->_docs, test->_test @quasilyte (#162)
  • _docs: update the manual @quasilyte (#182)

Dev

  • ci: add coverage @cristaloleg (#122)
  • fix CI @cristaloleg (#133)
  • add golangci config and enable go-critic @quasilyte (#143)
go-ruleguard - v0.2.1

Published by github-actions[bot] almost 4 years ago

Changes

DSL

  • ruleguard: allow error type in Implements() filter @quasilyte (#120)
  • ruleguard,dsl: add experimental support for const value filters @quasilyte (#116)
  • ruleguard,dsl: add File.PkgPath filter support @quasilyte (#106)
  • ruleguard: give error on repeated DSL calls @quasilyte (#102)
  • ruleguard,dsl: add File.Name filter support @quasilyte (#101)
  • all: add ExprType.Underlying() method @quasilyte (#89)
  • ruleguard/typematch: implement struct type pattern matching @quasilyte (#87)
  • ruleguard: support parenthesized expressions in Where @lamg (#76)

CLI

  • ruleguard,analyzer: implement rules debugging @quasilyte (#104)
  • all: add support for the File filters in Where clause @quasilyte (#83)
  • ruleguard/typematch: implement func type patterns @quasilyte (#82)

Rules

  • rules.go: add context.TODO @cristaloleg (#119)
  • rules.go: add badLock rule @quasilyte (#86)
  • rules.go: add exprUnparen rule @quasilyte (#85)

Bug fixes

  • fix bug in types.Identical rule @orsinium (#95)
  • Drop always true statement @orsinium (#97)
  • ruleguard: unquote the pattern string properly @quasilyte (#73)
  • ruleguard: handle *ast.ExprStmt during the filtering @quasilyte (#69)

Docs

go-ruleguard -

Published by quasilyte about 4 years ago

Now with Go modules.

The v0.1.4 introduced the backward-incompatible change.
It was intended to be a minor version bump, but oh well.

go-ruleguard - Multi rule sets support

Published by quasilyte about 4 years ago

  • -rules now support multiple rule files (comma separated list)
  • ruleguard package exports a function for rule sets merging
go-ruleguard - Wide suggestions fix

Published by quasilyte about 4 years ago

  • Fixed #57
go-ruleguard - Minor improvements release

Published by quasilyte over 4 years ago

  • dsl/fluent dependency is embedded into the ruleguard (#23)
  • Source text is used for the interpolation (#11)
go-ruleguard - First open release

Published by quasilyte almost 5 years ago

This version includes basic functionality and is considered to be good enough for trying it out.

Upcoming releases are going to address any issues found during this one.

Please submit an issue if you have any problems with ruleguard: https://github.com/quasilyte/go-ruleguard/issues/new

Package Rankings
Top 1.31% on Proxy.golang.org
Badges
Extracted from project README
PkgGoDev