Skip to content

Commit 99eddbd

Browse files
charliermarshzanieb
authored andcommitted
Remove stale preview documentation from stabilized rule behaviors (#9759)
These behaviors were stabilized, so the docs referring to them as preview-only are incorrect.
1 parent 836d2ea commit 99eddbd

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

crates/ruff_linter/src/rules/flake8_simplify/rules/ast_expr.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ impl Violation for UncapitalizedEnvironmentVariables {
6969
/// `None` is the default value for `dict.get()`, so it is redundant to pass it
7070
/// explicitly.
7171
///
72-
/// In [preview], this rule applies to variables that are inferred to be
73-
/// dictionaries; in stable, it's limited to dictionary literals (e.g.,
74-
/// `{"foo": 1}.get("foo", None)`).
75-
///
7672
/// ## Example
7773
/// ```python
7874
/// ages = {"Tom": 23, "Maria": 23, "Dog": 11}
@@ -87,8 +83,6 @@ impl Violation for UncapitalizedEnvironmentVariables {
8783
///
8884
/// ## References
8985
/// - [Python documentation: `dict.get`](https://docs.python.org/3/library/stdtypes.html#dict.get)
90-
///
91-
/// [preview]: https://docs.astral.sh/ruff/preview/
9286
#[violation]
9387
pub struct DictGetWithNoneDefault {
9488
expected: SourceCodeSnippet,

crates/ruff_linter/src/rules/flake8_simplify/rules/key_in_dict.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ use crate::checkers::ast::Checker;
3131
/// ## Fix safety
3232
/// Given `key in obj.keys()`, `obj` _could_ be a dictionary, or it could be
3333
/// another type that defines a `.keys()` method. In the latter case, removing
34-
/// the `.keys()` attribute could lead to a runtime error.
35-
///
36-
/// As such, this rule's fixes are marked as unsafe. In [preview], though,
37-
/// fixes are marked as safe when Ruff can determine that `obj` is a
38-
/// dictionary.
34+
/// the `.keys()` attribute could lead to a runtime error. The fix is marked
35+
/// as safe when the type of `obj` is known to be a dictionary; otherwise, it
36+
/// is marked as unsafe.
3937
///
4038
/// ## References
4139
/// - [Python documentation: Mapping Types](https://docs.python.org/3/library/stdtypes.html#mapping-types-dict)

crates/ruff_linter/src/rules/pycodestyle/rules/module_import_not_at_top_of_file.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use crate::checkers::ast::Checker;
1313
/// According to [PEP 8], "imports are always put at the top of the file, just after any
1414
/// module comments and docstrings, and before module globals and constants."
1515
///
16-
/// In [preview], this rule makes an exception for `sys.path` modifications,
17-
/// allowing for `sys.path.insert`, `sys.path.append`, and similar
18-
/// modifications between import statements.
16+
/// This rule makes an exception for `sys.path` modifications, allowing for
17+
/// `sys.path.insert`, `sys.path.append`, and similar modifications between import
18+
/// statements.
1919
///
2020
/// ## Example
2121
/// ```python
@@ -37,7 +37,6 @@ use crate::checkers::ast::Checker;
3737
/// ```
3838
///
3939
/// [PEP 8]: https://peps.python.org/pep-0008/#imports
40-
/// [preview]: https://docs.astral.sh/ruff/preview/
4140
#[violation]
4241
pub struct ModuleImportNotAtTopOfFile {
4342
source_type: PySourceType,

0 commit comments

Comments
 (0)