mirror of https://github.com/astral-sh/ruff
[ty] Document `TY_CONFIG_FILE` (#22001)
This commit is contained in:
parent
b2b0ad38ea
commit
5b1d3ac9b9
|
|
@ -2,6 +2,15 @@
|
|||
|
||||
ty defines and respects the following environment variables:
|
||||
|
||||
### `TY_CONFIG_FILE`
|
||||
|
||||
Path to a `ty.toml` configuration file to use.
|
||||
|
||||
When set, ty will use this file for configuration instead of
|
||||
discovering configuration files automatically.
|
||||
|
||||
Equivalent to the `--config-file` command-line argument.
|
||||
|
||||
### `TY_LOG`
|
||||
|
||||
If set, ty will use this value as the log level for its `--verbose` output.
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ use ty_combine::Combine;
|
|||
use ty_project::metadata::options::{EnvironmentOptions, Options, SrcOptions, TerminalOptions};
|
||||
use ty_project::metadata::value::{RangedValue, RelativeGlobPattern, RelativePathBuf, ValueSource};
|
||||
use ty_python_semantic::lint;
|
||||
use ty_static::EnvVars;
|
||||
|
||||
// Configures Clap v3-style help menu colors
|
||||
const STYLES: Styles = Styles::styled()
|
||||
|
|
@ -121,7 +122,7 @@ pub(crate) struct CheckCommand {
|
|||
/// The path to a `ty.toml` file to use for configuration.
|
||||
///
|
||||
/// While ty configuration can be included in a `pyproject.toml` file, it is not allowed in this context.
|
||||
#[arg(long, env = "TY_CONFIG_FILE", value_name = "PATH")]
|
||||
#[arg(long, env = EnvVars::TY_CONFIG_FILE, value_name = "PATH")]
|
||||
pub(crate) config_file: Option<SystemPathBuf>,
|
||||
|
||||
/// The format to use for printing diagnostic messages.
|
||||
|
|
|
|||
|
|
@ -39,6 +39,14 @@ impl EnvVars {
|
|||
/// when necessary, e.g. to watch for file system changes or a dedicated UI thread.
|
||||
pub const TY_MAX_PARALLELISM: &'static str = "TY_MAX_PARALLELISM";
|
||||
|
||||
/// Path to a `ty.toml` configuration file to use.
|
||||
///
|
||||
/// When set, ty will use this file for configuration instead of
|
||||
/// discovering configuration files automatically.
|
||||
///
|
||||
/// Equivalent to the `--config-file` command-line argument.
|
||||
pub const TY_CONFIG_FILE: &'static str = "TY_CONFIG_FILE";
|
||||
|
||||
/// Used to detect an activated virtual environment.
|
||||
pub const VIRTUAL_ENV: &'static str = "VIRTUAL_ENV";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue