Conversation
…metadata rake_tasks.rb matched spec/tasks/, which has never existed, so rake specs had to set type: :task by hand. Point it at spec/lib/tasks/ and remove the explicit type: from the 12 specs in codebar#2934. Exclude spec/lib/tasks from RSpec/DescribeClass, since RuboCop cannot see path-derived metadata, and describe WorkshopPresenter by class instead of tagging it type: :model.
mroderick
approved these changes
Sep 28, 2026
mroderick
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed and verified in a worktree of the PR branch:
- The root cause is real:
spec/support/rake_tasks.rbtagged files via%r{/spec/tasks/}, a directory that doesn't exist; the rake specs live inspec/lib/tasks/and only gottype: :taskfrom their explicit per-file tags. The fix points the derived metadata at the real path, andconfig.include TaskExampleGroup, type: :taskis the onlytype:consumer in the support stack. - The other tag removals are safe:
infer_spec_type_from_file_location!has no mappings forspec/services,spec/presenters, orspec/lib/tasks, and nothing includes an example group for:service. All 12 files listed in #2934 match the changed spec files. workshop_presenter_capacity_spec.rbnow matches its siblingworkshop_presenter_spec.rb(class describe +described_class), which was already written that way.- The
RSpec/DescribeClassexclusion is scoped tospec/lib/tasks/**/*only. - Ran from the worktree: full
parallel_rspec spec/ -n 3— 1552 examples, 0 failures;rspec spec/lib/tasks --dry-run --tag type:task— all 18 rake examples selected via the path-derived tag; fullrubocop— 436 files, no offenses.
mroderick
enabled auto-merge
September 28, 2026 06:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2934
infer_spec_type_from_file_location!doesn't coverspec/services,spec/presentersorspec/lib/tasks, so not all of thetype:metadata in these specs was redundant. Removingtype: :taskbreaks the rake specs, becauseTaskExampleGroup(which definestask) is only included for that type.spec/support/rake_tasks.rbwas meant to add the tag automatically, but it matched%r{/spec/tasks/}, a folder that didn't exist. This changes it to%r{/spec/lib/tasks/}and drops thetype:from all 12 specs listed in the issue.RuboCop's
RSpec/DescribeClassonly allows a string describe when it can see a type liketype: :taskin the file, and it can't see tags that RSpec assigns from the path. Sospec/lib/tasks/**/*is now excluded from that cop in.rubocop.yml.workshop_presenter_capacity_spec.rbwas a string taggedtype: :model. It now usesdescribe WorkshopPresenteranddescribed_class, the same asworkshop_presenter_spec.rb. Nothing uses:service, so the service specs behave the same.Testing
bundle exec parallel_rspec spec/ -n 3: 1552 examples, 0 failuresbundle exec rspec spec/lib/tasks --dry-run --tag type:task: all 18 rake examples selected (the tag now comes from the path)bundle exec rubocop: no offenses