troessner / reek

Code smell detector for Ruby
https://github.com/troessner/reek
MIT License
4k stars 279 forks source link

Allow failing safely when trying to recursively find a configuration … #1684

Closed gonubana closed 1 year ago

gonubana commented 1 year ago

…file

instead of triggering 'Permission denied @ dir_initialize - (Errno::EACCES)' by attempting to list an ancestor directory for which we don't have sufficient permissions.

# Will never raise 'Errno::EACCES'.
Pathname.pwd.ascend { |d| p d }

# Can raise 'Errno::EACCES' as nothing guarantees that we have enough
# permissions to list every ancestor directory of our working directort.
Pathname.pwd.ascend { |d| p d.children }
troessner commented 1 year ago

Looks good to me - @mvz wdyt?

mvz commented 1 year ago

Yes, the code looks good and I've managed to reproduce the problem locally as well.

troessner commented 1 year ago

Just released 6.1.3 with the fix, thanks @gonubana !