FileList#<< bypasses exclusions while FileList#include respects them
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2.5k
- Forks
- 650
- Avg merge
- 6m
- Merged PRs (30d)
- 3
Description
Problem
The << and include methods behave inconsistently with exclusions:
excludetheninclude: exclusion wins (correct)excludethen<<: file gets included anyway (bug)
Example
include_list = FileList.new
include_list.exclude 'abc.c'
include_list.include 'abc.c' # Correctly excluded: []
shovel_list = FileList.new
shovel_list.exclude 'abc.c'
shovel_list << 'abc.c' # Bug: returns ["abc.c"]
shovel_list.resolve # Still returns ["abc.c"] - resolve doesn't fix it
shovel_list.include 'xyz.rb' # Now returns ["xyz.rb"], "abc.c" is finally removed
Fix
Add resolve_exclude to the << method:
def <<(obj)
resolve
@items << Rake.from_pathname(obj)
resolve_exclude # ADD THIS LINE
self
end
I have a PR with fix & tests ready to go if this approach looks good to maintainers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with FileList#<< and compare its exclusion handling with FileList#include and resolve_exclude. Reproduce the abc.c example and verify that a file excluded before being appended remains absent after resolving; confirm the associated fix and tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100