Skip to content

Commit 0f1221b

Browse files
committed
Exclude non-ruby files even if they are provided as includes
1 parent 3cb3fc3 commit 0f1221b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/cc/engine/file_list_resolver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def find_target_files(path)
3333
end
3434

3535
def target_finder
36-
@_target_finder ||= RuboCop::TargetFinder.new(builds_config.rubocop_config_store)
36+
@_target_finder ||= RuboCop::TargetFinder.new(builds_config.rubocop_config_store, force_exclusion: true)
3737
end
3838
end
3939
end

spec/cc/engine/file_list_resolver_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,14 @@ module CC::Engine
7676
expect(resolver.expanded_list).to eq [Pathname.new("src/b.rb").realpath.to_s]
7777
end
7878
end
79+
80+
it "handles non-ruby files from include paths" do
81+
Dir.chdir(@code) do
82+
create_source_file("not_ruby.txt", "some text")
83+
84+
resolver = FileListResolver.new(root: @code, engine_config: {"include_paths" => %w[not_ruby.txt]}, builds_config: builds_config)
85+
expect(resolver.expanded_list).to be_empty
86+
end
87+
end
7988
end
8089
end

0 commit comments

Comments
 (0)