Skip to content

chore(lint): the environment is read only through Variable - #720

Draft
PiquelChips wants to merge 1 commit into
mainfrom
chore/ban-env-reads
Draft

PiquelChips wants to merge 1 commit into
mainfrom
chore/ban-env-reads

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

What and why

std::env::var, var_os and vars are now banned in clippy.toml, so configuration is read only through Variable, which names the variable and keeps a secret out of its errors.

  • Variable::os is the one environment read, with the lint's single #[expect] in the implementation. SecretReference::resolve, Variable::optional and the new Variable::raw and Variable::is_set go through it.
  • The NO_COLOR and TERM checks of the CLI's output and the UPDATE_* flags of the reference and vector tests use Variable.
  • Database tests read TEST_DATABASE_URL through one Database::test_url() instead of six copies of std::env::var.

Two more #[expect(clippy::disallowed_methods)], each saying why:

  • crates/common/src/protocol/typescript.rs: Variable needs common's config feature, which the crate's own tests do not enable.
  • crates/auth-sdk/examples/notes.rs: the example shows applications that read settings with std::env; it should not teach Variable.

Testing

cargo clippy -- -D warnings passes over the workspace and over each crate alone; nextest passes for common, crypto and auth-service, and just db scratch with the repository's tests (--run-ignored all) passes (87 tests). just docs passes.

Note

Written by Claude Sonnet 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant