mirror of https://github.com/astral-sh/ruff
Update examples
This commit is contained in:
parent
48f8815c4d
commit
9867bbf9fe
|
|
@ -1226,17 +1226,21 @@ pub struct TerminalOptions {
|
||||||
/// An override allows you to apply different rule configurations to specific
|
/// An override allows you to apply different rule configurations to specific
|
||||||
/// files or directories. Multiple overrides can match the same file, with
|
/// files or directories. Multiple overrides can match the same file, with
|
||||||
/// later overrides take precedence. Override rules take precedence over global
|
/// later overrides take precedence. Override rules take precedence over global
|
||||||
/// rules for matching files
|
/// rules for matching files.
|
||||||
|
///
|
||||||
|
/// For example, to relax enforcement of rules in test files:
|
||||||
///
|
///
|
||||||
/// ```toml title="pyproject.toml"
|
/// ```toml title="pyproject.toml"
|
||||||
/// # Relax rules for test files
|
|
||||||
/// [[tool.ty.overrides]]
|
/// [[tool.ty.overrides]]
|
||||||
/// include = ["tests/**", "**/test_*.py"]
|
/// include = ["tests/**", "**/test_*.py"]
|
||||||
///
|
///
|
||||||
/// [tool.ty.overrides.rules]
|
/// [tool.ty.overrides.rules]
|
||||||
/// possibly-unresolved-reference = "warn"
|
/// possibly-unresolved-reference = "warn"
|
||||||
|
/// ```
|
||||||
///
|
///
|
||||||
/// # Ignore generated files but still check important ones
|
/// Or, to ignore a rule in generated files but retain enforcement in an important file:
|
||||||
|
///
|
||||||
|
/// ```toml title="pyproject.toml"
|
||||||
/// [[tool.ty.overrides]]
|
/// [[tool.ty.overrides]]
|
||||||
/// include = ["generated/**"]
|
/// include = ["generated/**"]
|
||||||
/// exclude = ["generated/important.py"]
|
/// exclude = ["generated/important.py"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue