Skip to content

Files

Latest commit

 

History

History
21 lines (13 loc) · 418 Bytes

Style-NestedFileDirname.md

File metadata and controls

21 lines (13 loc) · 418 Bytes

Pattern: Use of nested File.dirname

Issue: -

Description

This rule checks for nested File.dirname. It replaces nested File.dirname with the level argument introduced in Ruby 3.1.

Examples

# bad
File.dirname(File.dirname(path))

# good
File.dirname(path, 2)

Further Reading