10 Commits

Author SHA1 Message Date
Issy Long
0872966c27
Avoid double parentheses for eg. (path/here/).rmtree corrections 2024-08-01 18:28:01 +01:00
Issy Long
7404735654
rubocops/no_fileutils_rmrf: Fix rmtree on a method returning Pathname
- Tidy up the node matchers. Either `FileUtils.rm_rf` or `rm_rf` on a
  `Pathname` instance or `self`.
2024-08-01 18:28:01 +01:00
Issy Long
83e21fba11
rubocop/no_fileutils_rmrf: Handle rmtree as an instance method 2024-08-01 18:28:00 +01:00
Issy Long
0889df837a
Casks use FileUtils.rm_rf & Pathname.rmtree still 2024-08-01 18:28:00 +01:00
Issy Long
99c5cc99b5
rubocop/no_fileutils_rmrf: Scope to just formulae and casks 2024-08-01 18:28:00 +01:00
Issy Long
14dd3592dc
rubocop/no_fileutils_rmrf: Discourage Pathname#rmtree too
- This [seems to be](https://ruby-doc.org/3.3.4/exts/pathname/Pathname.html#method-i-rmtree)
  equivalent to `FileUtils#rm_r`, so replace it with that.
2024-08-01 18:28:00 +01:00
Issy Long
cc7784605d
rubocop/no_fileutils_rmrf: Reorganize tests 2024-08-01 18:28:00 +01:00
Issy Long
ebd9d183dc
rubocop/no_fileutils_rmrf: Extend to cover FileUtils#rmtree too 2024-08-01 18:28:00 +01:00
Issy Long
f4e4808553
rubocop/no_fileutils_rmrf: Extend to cover FileUtils#rm_f too 2024-08-01 18:28:00 +01:00
Issy Long
e6976ae3d1
rubocop: Discourage the use of FileUtils.rm_rf
- This cop checks for the use of `FileUtils.rm_rf` and suggests using
  `FileUtils.rm_r` because we should know if we couldn't delete a
  thing for some reason, not just force it.
2024-08-01 18:27:59 +01:00