ruff/crates/ruff_cli/src
Aarni Koskela 7dabc4598b
Allow RUFF_NO_CACHE environment variable (like RUFF_CACHE_DIR) (#8538)
## Summary

Being able to set `--no-cache` without touching the command line makes
comparing formatter speed with e.g. Hyperfine a lot easier; Black allows
one to set `BLACK_CACHE_DIR=/dev/null`, but setting
`RUFF_CACHE_DIR=/dev/null` has Ruff choke:

```
error: Failed to initialize cache at /dev/null: Not a directory (os error 20)
error: Failed to initialize cache at /dev/null: Not a directory (os error 20)
warning: Failed to open cache file '/dev/null/0.1.4/18160934645386409287': Not a directory (os error 20)
```

Alternately, we could make a `/dev/null` (or `nul` on Windows) cache
directory imply `--no-cache`?

## Test Plan

None yet.
2023-11-07 08:35:28 -06:00
..
bin Replace .map_or(false, $closure) with .is_some_and(closure) (#6244) 2023-08-01 19:29:42 +02:00
commands Respect --force-exclude for lint.exclude and format.exclude (#8393) 2023-10-31 17:45:48 -04:00
snapshots Add ruff version with long version display (#8034) 2023-10-20 14:07:41 -05:00
args.rs Allow RUFF_NO_CACHE environment variable (like RUFF_CACHE_DIR) (#8538) 2023-11-07 08:35:28 -06:00
cache.rs Dedicated cache directory per ruff version (#8333) 2023-10-30 09:08:30 +00:00
diagnostics.rs Allow selective caching for --fix and --diff (#8316) 2023-10-29 16:06:35 +00:00
lib.rs Harmonize help commands' --format to --output-format with deprecation warnings (#8203) 2023-10-28 03:30:46 +00:00
panic.rs Disallow unreachable_pub (#4314) 2023-05-11 18:00:00 -04:00
printer.rs Avoid failed assertion when showing fixes from stdin (#8029) 2023-10-17 21:50:39 -04:00
resolve.rs Rename ConfigProcessor to ConfigurationTransformer (#7536) 2023-09-20 14:17:06 +00:00
stdin.rs Move stdin formatting to its own command file (#6981) 2023-08-29 16:06:10 +00:00
version.rs Add ruff version with long version display (#8034) 2023-10-20 14:07:41 -05:00