Skip to content

Files

Latest commit

 

History

History
29 lines (19 loc) · 505 Bytes

Lint-RedundantDirGlobSort.md

File metadata and controls

29 lines (19 loc) · 505 Bytes

Pattern: Redundant sort for Dir.glob/Dir[]

Issue: -

Description

This rule checks for redundant sort method to Dir.glob and Dir[].

Examples

# bad
Dir.glob('./lib/**/*.rb').sort.each do |file|
end

Dir['./lib/**/*.rb'].sort.each do |file|
end

# good
Dir.glob('./lib/**/*.rb').each do |file|
end

Dir['./lib/**/*.rb'].each do |file|
end

Further Reading