Skip to content

[GH-6765] Linter should fail if baseline no longer relevent#20

Merged
Ben Duffield (ben-duffield) merged 6 commits into
mainfrom
6765-linter-should-fail-if-baseline-no-longer-relevent
Apr 15, 2026
Merged

[GH-6765] Linter should fail if baseline no longer relevent#20
Ben Duffield (ben-duffield) merged 6 commits into
mainfrom
6765-linter-should-fail-if-baseline-no-longer-relevent

Conversation

@ben-duffield

Copy link
Copy Markdown
Contributor
[GH-6765] Linter should fail if baseline no longer relevent

@@ -0,0 +1,32 @@
RSpec::Matchers.define :be_empty_with_exceptions do |custom_message=nil, allowlist: nil, baseline: nil|

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also do the same for be_true and be_false?

We could also update the existing matchers to accept an optional allowlist and baseline, instead of having different matchers.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, how would this work with different types of baseline?

For example, sometimes we have a baseline of classes, or baseline of files, or baseline of method names, etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works with classes / and filenames because it check against each of the fields... Sorry this should of still been a draft

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about be_true and be_false?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we truly have no consumer for the be_true and be_false` matchers with baselines, then I am ok pushing this to a future PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we update the existing matchers to add an optional param of baseline? Wouldn't this be more consistent with the existing API?

class ModulesCollection < BaseCollection
include Rubyzen::Providers::CollectionFilterProvider

def all_methods

@bkoell Bastian (bkoell) Apr 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: check if classes collection is doing this and has same name

@bkoell Bastian (bkoell) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge and tag this Rubyzen release. Then update the version tag in a Husband-Redis PR and merge.

@ben-duffield Ben Duffield (ben-duffield) merged commit 56ccf85 into main Apr 15, 2026
1 check failed
@ben-duffield Ben Duffield (ben-duffield) deleted the 6765-linter-should-fail-if-baseline-no-longer-relevent branch April 15, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants