mirror of
https://github.com/openai/codex.git
synced 2026-11-16 22:00:36 +00:00
Choosing module granularity over item granularity is based on a similar choice made in the standard library to balance readabilty, with easy to read diffs. This saves 2098 lines or about 33% of the lines spent writing imports. This is beneficial to both human readers who have to scroll past large import blocks when reading a file as well as codex which shouldn't have to add as many tokens to its context. Manual changes to rustfmt.toml, rust-ci.yml, justfile, docs/contributing and docs/install. The actual format commit is intentionally in a second commit to make it easier to rebase this PR as main moves (drop the next commit and re-run cargo +nightly fmt). Added cargo nightly to the ci and justfile. In theory this is unstable, but in real world use this tends to hit a problems perhaps once every 6 months. The fix is usually fairly easy (pin a version briefly), and the problems tend to be fixed pretty quickly.
13 lines
597 B
TOML
13 lines
597 B
TOML
edition = "2024"
|
|
|
|
# The following settings are unstable. Generally, to use these settings, you can either use a
|
|
# nightly toolchain, or add each args to the cargo fmt command. If using stable, these will emit a
|
|
# warning when running cargo fmt.
|
|
|
|
# Grouping imports by module is a reasonable compromise between readability and conciseness that
|
|
# saves about 2000 lines (33%) compared to grouping by item, while still keeping related imports
|
|
# together in a way that works well with diffs and code navigation.
|
|
group_imports = "StdExternalCrate"
|
|
imports_granularity = "Module"
|
|
reorder_imports = true
|