Skip to content

Changelog

  • Trace/non-trace detection unified*WithTrace variants are now canonical implementations; non-trace versions are thin wrappers. Eliminates the biggest source of code duplication.
  • coverage_test.go dissolved — Tests moved to their natural test files (errors_test.go, filter_test.go, pattern_test.go, sqlc_test.go, project_test.go).
  • Test string literals centralized — Repeated test constants extracted to testhelpers/constants.go and named constants in testdata_test.go.
  • FilterResult construction DRYed upfilteredResult() and notFilteredResult() helpers eliminate repetitive struct literal construction.
  • Error system simplified — Removed errorCodeDefs table, AllErrorCodes(), CodeHelp(), Helper interface, CodeEqual[T] generic. Kept ErrorCode, ErrorCoder, sentinel errors, branded prefix.
  • Phantom types removedStartPath, ConfigPath, Operation, ErrorMessage replaced with plain string fields.
  • Detection helpers unexportedMatchesSQLCFilename, HasSQLCContent, HasSQLCCodePatterns → unexported. Use DetectReason() or Filter.
  • codeGeneratedPrefix moved to detection.go — Only used there, not in types.go.
  • matchAnyContentPattern renamedmatchesAnyContentPattern for consistency.
  • Filter.String() improved — Better debug output showing options, include, and exclude patterns.
  • parseV1AsV2 cleaned up — Removed zero-value noise from struct construction.
  • validatable interface removed — Dead code in production.
  • Plausible analytics removed from website — Tightened Content Security Policy.
  • Flake configuration improved — Better nix build setup.
  • Release workflow added — Tag-based GitHub release with automated tests, lint, and release notes.
  • Website CI: checkout path parameter placement
  • Website CI: private repo access fallback
  • Benchmark CI: missing gh-pages branch
  • Lighthouse CI: budgets+assertions conflict
  • Node.js 20 deprecation — updated actions/setup-go@v5@v6
  • DetectReasonReader(filePath string, r io.Reader, opts ...FilterOption) (FilterReason, error) — detection from an io.Reader
  • Filter(filePath string) (bool, error) — replaces ShouldFilter with cleaner name
  • FilterResult struct with Filtered, Reason, Path, Trace fields
  • FilterDetailed(filePath string) (FilterResult, error) — detailed result with trace info
  • FilterPathsDetailed(paths []string) ([]FilterResult, error) — batch detailed results
  • AllGeneratorOptions() — enumerate detector options (excludes FilterAll)
  • FilterResult.String() — human-readable representation
  • Filter.FilterReasons() — returns the FilterReason values this filter will detect
  • Filter.String() — human-readable debug representation of filter state
  • Module path /v3 suffix for Go module convention compliance
  • ShouldFilter renamed to Filter — the method ShouldFilter(filePath string) (bool, error) is now Filter(filePath string) (bool, error).
  • Enabled() and Disabled() removed — filter is enabled by passing options to NewFilter(); NewFilter() with no args is disabled.
  • Breaking: Cause field renamed to Err on all error types — follows Go stdlib convention (os.PathError.Err, net.OpError.Err).
  • Breaking: FilterOption.Reason() returns (FilterReason, bool) — no panics on FilterAll.
  • Breaking: WithFilterOptions returns (FilterConfig, error) — returns *FilterConfigError for invalid options instead of panicking.
  • Breaking: NewFilter returns (*Filter, error) — uses errors.Join() to aggregate config errors.
  • IsValid() methods derived from tables
  • SQLC patterns consolidated
  • WithFilterOptions reuses optionsMap
  • slog dependency removed
  • IsEnabled() derives state from configuration
  • errors.AsType[T] migration complete — Go 1.26 exclusively
  • Silent misconfigurationNewFilter(WithFilterOptions(FilterAll)) now works without Enabled()
  • Leaky fs.FS abstractiondetectReasonFS no longer falls back to os.ReadFile for custom filesystems
  • Website CI checkout path parameter placement
  • Lighthouse CI budgets+assertions conflict
  • Metrics systemMetrics, MetricsMixin, FilterStats, GetStats, FilteredBy, FilteredFiles, TotalFiltered, WithMetricsCap. Stats aggregation is the caller’s responsibility.
  • Phantom typesStartPath, ConfigPath, Operation, ErrorMessage. All error struct fields are now plain string.
  • Context methodsFilterContext, FilterDetailedContext, FilterPathsContext. They promised cancellation over synchronous I/O.
  • Error system over-engineeringerrorCodeDefs table, AllErrorCodes(), CodeHelp(), Helper interface, CodeEqual[T] generic, Causable interface.
  • Detection helpers unexportedMatchesSQLCFilename, HasSQLCContent, HasSQLCCodePatterns.
  • TotalFilesChecked phantom type
  • os.ReadFile fallback in detectReasonFS
  • warnMultipleSQLCConfigs function and all slog usage
  • sqlcConfigError() bridge function
  • MustFilter / MustShouldFilter panic-on-error variant
  • Plausible analytics
  • FilterPaths(paths []string) ([]bool, error) — batch filtering; returns partial results on error
  • FilterConfigError type — returned when invalid filter options are provided; implements ErrorCoder and Unwrap
  • ErrInvalidFilterOption sentinel error — for errors.Is() matching
  • CodeInvalidFilterOption error code — for programmatic error handling
  • Breaking: WithFilterOptions returns (FilterConfig, error) — previously panicked on invalid options
  • Breaking: NewFilter returns (*Filter, error) — previously returned *Filter only
  • Breaking: FilterConfig returns error — config functions now return error to support validation
  • Breaking: Enabled() and Disabled() removed — filter is enabled when options are provided
  • Silent misconfigurationNewFilter(WithFilterOptions(FilterAll)) without Enabled() silently did nothing; now passing options automatically enables the filter
  • Initial release
  • Two-phase detection: filename-based (zero I/O) then content-based
  • 11 generator detectors: sqlc, templ, go-enum, protobuf, oapi-codegen, deepcopy-gen, wire, moq, mockgen, stringer, generic
  • Functional options API: WithFilterOptions(), WithFS(), WithIncludePatterns(), WithExcludePatterns()
  • fs.FS abstraction for testing
  • SQLC config discovery
  • Glob pattern matching with ** support
  • Branded error types with sentinel errors