Skip to content

Commit

Permalink
Link to implementation for all configuration options
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Dec 12, 2024
1 parent c1901d5 commit ae290a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/red_knot_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ license.workspace = true
[dependencies]
red_knot_python_semantic = { workspace = true, features = ["serde"] }
red_knot_vendored = { workspace = true }
ruff_db = { workspace = true }
ruff_db = { workspace = true, features = ["testing"] }
ruff_index = { workspace = true }
ruff_python_trivia = { workspace = true }
ruff_source_file = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions crates/red_knot_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ python-version = "3.10"
This configuration will apply to all tests in the same section, and all nested sections within that
section. Nested sections can override configurations from their parent sections.

See [`MarkdownTestConfig`](https://github.com/astral-sh/ruff/blob/main/crates/red_knot_test/src/config.rs) for the full list of supported configuration options.

## Documentation of tests

Arbitrary Markdown syntax (including of course normal prose paragraphs) is permitted (and ignored by
Expand Down
4 changes: 4 additions & 0 deletions crates/red_knot_test/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use serde::Deserialize;
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
pub(crate) struct MarkdownTestConfig {
pub(crate) environment: Option<Environment>,

pub(crate) log: Option<Log>,
}

Expand All @@ -32,12 +33,15 @@ impl MarkdownTestConfig {
#[derive(Deserialize, Debug, Default, Clone)]
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
pub(crate) struct Environment {
/// Python version to assume when resolving types.
pub(crate) python_version: Option<PythonVersion>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(untagged)]
pub(crate) enum Log {
/// Enable logging with tracing when `true`.
Bool(bool),
/// Enable logging and only show filters that match the given [env-filter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html)
Filter(String),
}

0 comments on commit ae290a4

Please sign in to comment.