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.4.2 Latest Release

Published by github-actions[bot] 8 months ago

Changes

  • Fix for Go 1.22 @cristaloleg (#473)
go-ruleguard - v0.4.1

Published by cristaloleg 8 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/quasilyte/go-ruleguard/compare/v0.4.0...v0.4.1

go-ruleguard - v0.4.0

Published by cristaloleg about 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/quasilyte/go-ruleguard/compare/v0.3.20...v0.4.0

go-ruleguard - v0.3.20

Published by github-actions[bot] about 1 year ago

Changes

  • Make go env vars static @liggitt (#456)
  • Make goenv parsing robust across go versions and OSes @liggitt (#455)
  • update x/tools: v0.7.0 => v0.11.0 @quasilyte (#450)
  • chore: update golang.org/x dependencies @lizthegrey (#438)

What's Changed

New Contributors

Full Changelog: https://github.com/quasilyte/go-ruleguard/compare/v0.3.19...v0.3.20

go-ruleguard - v0.3.19

Published by github-actions[bot] over 1 year ago

Changes

  • go.mod: use tagged gogrep lib @quasilyte (#435)
  • ruleguard: implement Object.IsVariadicParam() filter @quasilyte (#428)
  • README typos @cristiangreco (#426)
  • rules: add sort.Float64s to sortFuncs @junk1tm (#418)
  • docs: update links and fix a few typos @junk1tm (#419)
  • analyzer: use sync.Pool to re-use ruleguard runner state @quasilyte (#416)
  • ruleguard: introduce reusable runner state @quasilyte (#415)
  • build(deps): bump github.com/google/go-cmp from 0.5.8 to 0.5.9 @dependabot (#405)
  • ruleguard/typematch: replace Split with Index to avoid allocs @quasilyte (#414)
  • ruleguard: remove matchData allocations @quasilyte (#413)
  • Add troubleshooting sectipon to README.md @mem (#411)
  • ruleguard: fix sizeof filter for type params @quasilyte (#407)
  • Create dependabot.yml @cristaloleg (#401)
go-ruleguard - v0.3.18

Published by github-actions[bot] about 2 years ago

Changes

  • update deps @quasilyte (#400)
  • internal/xtypes: handle new Union and TypeParam types @quasilyte (#399)
go-ruleguard - v0.3.17

Published by github-actions[bot] about 2 years ago

Changes

go-ruleguard - v0.3.16

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

Changes

  • ruleguard: implement SinkType filter @quasilyte (#384)
  • dsl: add SinkType @quasilyte (#383)
  • ruleguard: implement Var.Comparable predicate @quasilyte (#382)
  • chore: update xtools to 0.1.10 for go1.18 @deansheather (#381)
  • ruleguard: implement dsl Do() function @quasilyte (#379)
  • all: allow calling quasigo functions from quasigo @quasilyte (#378)
  • ruleguard/quasigo: pass args via ValueStack @quasilyte (#377)
  • change group filter signature @peakle (#376)
  • add global property for Var @peakle (#370)
  • add IsGlobal method to dsl @peakle (#375)
  • ruleguard/typematch: use external matcher state @quasilyte (#374)
  • ruleguard: use stdinfo PathByName and don't make excessive copies @quasilyte (#373)
  • all: use quasilyte/stdinfo, remove internal/stdinfo @advimirl (#371)
  • ruleguard: make sub-match gogrep state per-runner @quasilyte (#367)
  • ruleguard: implement Type.IdenticalTo method @quasilyte (#365)
  • all: implement sub-matches support @quasilyte (#363)
  • dsl: add submatches experimental API @quasilyte (#362)
  • analyzer: add tests for #360 @quasilyte (#361)
  • ruleguard/typematch: handle unsafe.Pointer correctly @quasilyte (#359)
  • ruleguard/typematch: improve function type matching @quasilyte (#358)
  • ruleguard: implement Type.Size expr on the RHS @quasilyte (#356)
  • ruleguard: make truncate len configurable @quasilyte (#354)
  • ruleguard: autofix some interpolated expressions @quasilyte (#353)
  • ruleguard: do less copying in ir loader @quasilyte (#352)
  • ruleguard/irprint: make printed IR ~15% more compact @quasilyte (#351)
  • ruleguard: implement ExprType.HasMethod() @quasilyte (#350)
  • dsl: add ExprType.HasMethod() @quasilyte (#349)
  • analyzer: add quickfix tests @quasilyte (#347)
  • update release version and binaries @quasilyte (#346)
go-ruleguard - v0.3.15

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

Changes

  • ruleguard: pass imports table to gogrep pattern compiler @quasilyte (#343)
  • ruleguard: better text truncation in the rendered message @quasilyte (#330)
  • ruleguard: assign the current func decl @quasilyte (#328)
  • ruleguard,analyzer: change Report() callback argument @quasilyte (#327)

DSL

  • ruleguard: implement ExprType.HasPointers() predicate @quasilyte (#337)
  • dsl: add ExprType.HasPointers() predicate @quasilyte (#336)
  • ruleguard: implement Type.OfKind filter @quasilyte (#334)
  • dsl: add Type.OfKind method @quasilyte (#332)

Fixes

  • ruleguard: improve FieldList and Field matching @quasilyte (#342)
  • ruleguard: continue pattern matching for multi-match patterns @quasilyte (#340)
  • close test descriptor @peakle (#335)

Performance

  • ruleguard: call Walk handler with nodetag @quasilyte (#341)

Other

  • ruleguard: add profiling labels support @quasilyte (#338)
go-ruleguard - v0.3.14

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

Changes

Features

  • ruleguard: add support for local functions @quasilyte (#298)

Other

  • update gogrep version @quasilyte (#324)
  • all: use external gogrep, remove internal/gogrep @quasilyte (#319)
  • add build ignore line to ignore rules.go @harshavardhana (#305)
  • Upgrade go.mod to use most recent ruleguard v0.3.13 @sebastien-rosset (#297)
  • internal/gogrep: allow $*_ (optnode) in valuespec type @quasilyte (#296)

Testing

  • add test for issue317 @peakle (#322)
  • internal/gogrep: add more append tests @quasilyte (#314)
  • ruleguard: add TODO error test for local funcs @quasilyte (#300)
  • Add testing for const iota rules @timkral (#293)

Docs

  • all: update gogrep links, we're using a different gogrep now @quasilyte (#320)
  • fix typo in readme @peakle (#313)
  • readme: add one more rule in the examples @quasilyte (#299)

Custom filters

  • ruleguard/quasigo: add variadic native func calls support @quasilyte (#312)
  • ruleguard/quasigo: enable multi-return + add strconv lib support @quasilyte (#311)
  • ruleguard/quasigo: add some strings package wrappers @quasilyte (#309)
  • ruleguard/quasigo: emit implicit return stmt @quasilyte (#308)
  • ruleguard/quasigo: implement void funcs @quasilyte (#307)
go-ruleguard - v0.3.13

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

Changes

  • fix go env parsing for Windows @quasilyte (#289)
  • improve CGO_ENABLED inference
  • produce release binaries for windows/arm64 as well
go-ruleguard - v0.3.12

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

Changes

  • all: overcoming srcimporter issues @quasilyte (#288)
go-ruleguard - v0.3.11

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

Changes

  • ruleguard: give error message when filter uses undefined var @quasilyte (#282)
  • ruleguard: use a separate token.FileSet for gogrep parsing @quasilyte (#275)
  • ruleguard: associate rule line with a pattern string @quasilyte (#272)

DSL

  • ruleguard: implement ConstSlice predicate @quasilyte (#271)

Matching

  • internal/gogrep: add support for $*_ in slice expr members @quasilyte (#284)
  • internal/gogrep: implement struct{...} and interface{...} matching @quasilyte (#278)

Performance

  • ruleguard/textmatch: an abstraction on top of regexp for performance @quasilyte (#281)
  • internal/gogrep: use external MatcherState (no Clone() per Engine.Run() anymore) @quasilyte (#286)
  • internal/gogrep: make simple call patterns match faster @quasilyte (#277)
  • ruleguard: make printed IR more compact @quasilyte (#276)

Other

  • use || in go-ruleguard/analyzer/testdata/src/gocritic/rules.go @penthaapatel (#283)
  • analyzer/testdata: use \Q regexp quoting everywhere @quasilyte (#279)
go-ruleguard - v0.3.11-rc.3

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

Changes

  • internal/gogrep: implement struct{...} and interface{...} matching @quasilyte (#278)
  • internal/gogrep: make simple call patterns match faster @quasilyte (#277)
go-ruleguard - v0.3.11-rc.2

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

Changes

  • ruleguard: make printed IR more compact @quasilyte (#276)
go-ruleguard - v0.3.11-rc.1

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

Changes

  • ruleguard: use a separate token.FileSet for gogrep parsing @quasilyte (#275)
  • ruleguard: associate rule line with a pattern string @quasilyte (#272)
  • ruleguard: implement ConstSlice predicate @quasilyte (#271)
go-ruleguard - v0.3.10

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

Features

  • ruleguard: add deadcode filter @quasilyte (#267)
  • internal/stdinfo: update stdlib packages info @quasilyte (#261)

Fixes

  • internal/gogrep: fix declstmt matching in stmtlist @quasilyte (#263)
  • internal/gogrep: fix if $x {...} compilation @quasilyte (#268)
  • internal/gogrep: improve gendecl lists matching @quasilyte (#264)

Other

  • analyzer/testdata: more test rules @quasilyte (#269)
  • analyzer/testdata: add nodiscard example @quasilyte (#266)
  • analyzer: add uber style guide rules to the test suite @quasilyte (#265)
go-ruleguard - v0.3.9

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

Changes

  • all: make syntax patterns aware of stdlib packages @quasilyte (#260)
  • ruleguard: add Go version filters @quasilyte (#259)
  • ruleguard: add parent nodes support for $$ @quasilyte (#257)
go-ruleguard -

Published by quasilyte about 3 years ago

Experimental release.

Introducing IR layer to the ruleguard.

This is useful for applications that ember ruleguard rules, like go-critic.

This release is not recommended for general use.

go-ruleguard - v0.3.7

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

Changes

  • ruleguard: fix Var.Node.Is() filter for statements @quasilyte (#244)
  • ruleguard: implement dsl types.Object filter @quasilyte (#243)
Package Rankings
Top 1.31% on Proxy.golang.org
Badges
Extracted from project README
PkgGoDev