Skip to content
Merged
Prev Previous commit
Next Next commit
add docs to new flag
  • Loading branch information
ntBre committed Nov 26, 2024
commit 1b3ae3628983fe7258a7fb5c5f2eae021a1e3448
15 changes: 15 additions & 0 deletions crates/ruff_python_semantic/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2222,6 +2222,21 @@ bitflags! {
/// [PEP 257]: https://peps.python.org/pep-0257/#what-is-a-docstring
const ATTRIBUTE_DOCSTRING = 1 << 25;

/// The model is in a [no_type_check] context.
///
/// This is used to skip type checking when the `@no_type_check` decorator is found.
///
/// For example (adapted from [#13824]):
/// ```python
/// from typing import no_type_check
///
/// @no_type_check
/// def fn(arg: "A") -> "R":
/// pass
/// ```
///
/// [no_type_check]: https://docs.python.org/3/library/typing.html#typing.no_type_check
/// [#13824]: https://github.com/astral-sh/ruff/issues/13824
const NO_TYPE_CHECK = 1 << 26;

/// The context is in any type annotation.
Expand Down