Skip to content

Commit 22cf451

Browse files
authored
Release 0.1.1 (#8073)
- Add changelog entry for 0.1.1 - Bump version to 0.1.1 - Require preview for fix added in #7967 - Allow duplicate headings in changelog (markdownlint setting)
1 parent ec1be60 commit 22cf451

19 files changed

+354
-153
lines changed

.markdownlint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ MD041: false
1313

1414
# MD013/line-length
1515
MD013: false
16+
17+
# MD024/no-duplicate-heading
18+
MD024:
19+
# Allow when nested under different parents e.g. CHANGELOG.md
20+
allow_different_nesting: true

CHANGELOG.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,60 @@
11
# Changelog
22

3-
This is the first release which uses the `CHANGELOG` file. See [GitHub Releases](https://github.com/astral-sh/ruff/releases) for prior changelog entries.
3+
## 0.1.1
44

5-
Read Ruff's new [versioning policy](https://docs.astral.sh/ruff/versioning/).
5+
### Rule changes
6+
7+
- Add unsafe fix for `escape-sequence-in-docstring` (`D301`) (#7970)
8+
9+
### Configuration
10+
11+
- Respect `#(deprecated)` attribute in configuration options (#8035)
12+
- Add `[format|lint].exclude` options (#8000)
13+
- Respect `tab-size` setting in formatter (#8006)
14+
- Add `lint.preview` (#8002)
15+
16+
## Preview features
17+
18+
- \[`pylint`\] Implement `literal-membership` (`PLR6201`) (#7973)
19+
- \[`pylint`\] Implement `too-many-boolean-expressions` (`PLR0916`) (#7975)
20+
- \[`pylint`\] Implement `misplaced-bare-raise` (`E0704`) (#7961)
21+
- \[`pylint`\] Implement `global-at-module-level` (`W0604`) (#8058)
22+
- \[`pylint`\] Implement `unspecified-encoding` (`PLW1514`) (#7939)
23+
- Add fix for `triple-single-quotes` (`D300`) (#7967)
24+
25+
### Formatter
26+
27+
- New code style badge for `ruff format` (#7878)
28+
- Fix comments outside expression parentheses (#7873)
29+
- Add `--target-version` to `ruff format` (#8055)
30+
- Skip over parentheses when detecting `in` keyword (#8054)
31+
- Add `--diff` option to `ruff format` (#7937)
32+
- Insert newline after nested function or class statements (#7946)
33+
- Use `pass` over ellipsis in non-function/class contexts (#8049)
34+
35+
### Bug fixes
36+
37+
- Lazily evaluate all PEP 695 type alias values (#8033)
38+
- Avoid failed assertion when showing fixes from stdin (#8029)
39+
- Avoid flagging HTTP and HTTPS literals in urllib-open (#8046)
40+
- Avoid flagging `bad-dunder-method-name` for `_` (#8015)
41+
- Remove Python 2-only methods from `URLOpen` audit (#8047)
42+
- Use set bracket replacement for `iteration-over-set` to preserve whitespace and comments (#8001)
43+
44+
### Documentation
45+
46+
- Update tutorial to match revised Ruff defaults (#8066)
47+
- Update rule `B005` docs (#8028)
48+
- Update GitHub actions example in docs to use `--output-format` (#8014)
49+
- Document `lint.preview` and `format.preview` (#8032)
50+
- Clarify that new rules should be added to `RuleGroup::Preview`. (#7989)
651

752
## 0.1.0
853

54+
This is the first release which uses the `CHANGELOG` file. See [GitHub Releases](https://github.com/astral-sh/ruff/releases) for prior changelog entries.
55+
56+
Read Ruff's new [versioning policy](https://docs.astral.sh/ruff/versioning/).
57+
958
### Breaking changes
1059

1160
- Unsafe fixes are no longer displayed or applied without opt-in ([#7769](https://github.com/astral-sh/ruff/pull/7769))

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Ruff can also be used as a [pre-commit](https://pre-commit.com) hook:
140140
```yaml
141141
- repo: https://github.com/astral-sh/ruff-pre-commit
142142
# Ruff version.
143-
rev: v0.1.0
143+
rev: v0.1.1
144144
hooks:
145145
- id: ruff
146146
```

crates/flake8_to_ruff/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "flake8-to-ruff"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = """
55
Convert Flake8 configuration files to Ruff configuration files.
66
"""

crates/ruff_cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ruff_cli"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
publish = false
55
authors = { workspace = true }
66
edition = { workspace = true }

crates/ruff_linter/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ruff_linter"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
publish = false
55
authors = { workspace = true }
66
edition = { workspace = true }

crates/ruff_linter/src/rules/pydocstyle/mod.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ mod tests {
1212
use test_case::test_case;
1313

1414
use crate::registry::Rule;
15+
use crate::settings::types::PreviewMode;
1516
use crate::test::test_path;
1617
use crate::{assert_messages, settings};
1718

@@ -107,6 +108,33 @@ mod tests {
107108
Ok(())
108109
}
109110

111+
#[test_case(Rule::TripleSingleQuotes, Path::new("D.py"))]
112+
#[test_case(Rule::TripleSingleQuotes, Path::new("D300.py"))]
113+
fn preview_rules(rule_code: Rule, path: &Path) -> Result<()> {
114+
// Tests for rules with preview features
115+
let snapshot = format!(
116+
"preview__{}_{}",
117+
rule_code.noqa_code(),
118+
path.to_string_lossy()
119+
);
120+
let diagnostics = test_path(
121+
Path::new("pydocstyle").join(path).as_path(),
122+
&settings::LinterSettings {
123+
pydocstyle: Settings {
124+
convention: None,
125+
ignore_decorators: BTreeSet::from_iter(["functools.wraps".to_string()]),
126+
property_decorators: BTreeSet::from_iter([
127+
"gi.repository.GObject.Property".to_string()
128+
]),
129+
},
130+
preview: PreviewMode::Enabled,
131+
..settings::LinterSettings::for_rule(rule_code)
132+
},
133+
)?;
134+
assert_messages!(snapshot, diagnostics);
135+
Ok(())
136+
}
137+
110138
#[test]
111139
fn bom() -> Result<()> {
112140
let diagnostics = test_path(

crates/ruff_linter/src/rules/pydocstyle/rules/triple_quotes.rs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ pub(crate) fn triple_quotes(checker: &mut Checker, docstring: &Docstring) {
7878
let mut diagnostic =
7979
Diagnostic::new(TripleSingleQuotes { expected_quote }, docstring.range());
8080

81-
let body = docstring.body().as_str();
82-
if !body.ends_with('\'') {
83-
diagnostic.set_fix(Fix::safe_edit(Edit::range_replacement(
84-
format!("{prefixes}'''{body}'''"),
85-
docstring.range(),
86-
)));
81+
if checker.settings.preview.is_enabled() {
82+
let body = docstring.body().as_str();
83+
if !body.ends_with('\'') {
84+
diagnostic.set_fix(Fix::safe_edit(Edit::range_replacement(
85+
format!("{prefixes}'''{body}'''"),
86+
docstring.range(),
87+
)));
88+
}
8789
}
8890

8991
checker.diagnostics.push(diagnostic);
@@ -94,12 +96,14 @@ pub(crate) fn triple_quotes(checker: &mut Checker, docstring: &Docstring) {
9496
let mut diagnostic =
9597
Diagnostic::new(TripleSingleQuotes { expected_quote }, docstring.range());
9698

97-
let body = docstring.body().as_str();
98-
if !body.ends_with('"') {
99-
diagnostic.set_fix(Fix::safe_edit(Edit::range_replacement(
100-
format!("{prefixes}\"\"\"{body}\"\"\""),
101-
docstring.range(),
102-
)));
99+
if checker.settings.preview.is_enabled() {
100+
let body = docstring.body().as_str();
101+
if !body.ends_with('"') {
102+
diagnostic.set_fix(Fix::safe_edit(Edit::range_replacement(
103+
format!("{prefixes}\"\"\"{body}\"\"\""),
104+
docstring.range(),
105+
)));
106+
}
103107
}
104108

105109
checker.diagnostics.push(diagnostic);

0 commit comments

Comments
 (0)