Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rule selection to respect preview mode #7195

Merged
merged 34 commits into from
Sep 11, 2023
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9b4aee1
Rename a bunch of "nursery" references to "preview"
zanieb Aug 31, 2023
8fce454
Update ALL rule selector to include all rules then deselect preview r…
zanieb Aug 31, 2023
c527f69
Clarify `include_preview_rules` conditional
zanieb Aug 31, 2023
a954fd6
Fix conditional
zanieb Aug 31, 2023
2e44d66
WIP: Rename rule selector from nursery to preview
zanieb Aug 31, 2023
51bce02
Enable selection of preview rules
charliermarsh Sep 1, 2023
1689190
Make preview part of the selector API
charliermarsh Sep 1, 2023
2c830e2
Fix linter group comment
zanieb Sep 5, 2023
f111189
Add comment to `PerFileIgnore`
zanieb Sep 5, 2023
e6d491a
Restore nursery rule group for backwards compatible selection
zanieb Sep 5, 2023
97b80c0
Restore nursery selector
zanieb Sep 6, 2023
2b0dfd6
Fix macro generated `RuleSelector::from(code)` support for `RuleSelec…
zanieb Sep 6, 2023
359012a
Fix pyproject test
zanieb Sep 6, 2023
b60ce8b
Remove `prefix_to_selector`
zanieb Sep 6, 2023
950bd95
Update FAQ
zanieb Sep 6, 2023
ae80063
Fix benchmark rule selection
zanieb Sep 8, 2023
5ae0075
Clippy
zanieb Sep 6, 2023
a5200ed
Fix typo
zanieb Sep 6, 2023
83d888f
Add support for NURSERY selector (backwards compat)
zanieb Sep 6, 2023
45ceb6a
Disable preview mode during benchmarks
zanieb Sep 8, 2023
cb47f02
Separate test cases for selection
zanieb Sep 6, 2023
2d8f961
Add preview flag to test utility
zanieb Sep 6, 2023
550f787
Add tests for preview / nursery
zanieb Sep 6, 2023
c581006
Add test for select of linter; fix names of existing tests
zanieb Sep 6, 2023
f628e95
Add test cases for selection of NURSERY and PREVIEW groups
zanieb Sep 6, 2023
c092d62
Fix typo
zanieb Sep 6, 2023
32b34fa
Add unreachable code to test cases
zanieb Sep 6, 2023
fbd449a
Fix test case handling of RUF014
zanieb Sep 6, 2023
d94dfd7
Fix preview mode messages
zanieb Sep 7, 2023
e7f095a
Deprecate `RuleSelector::Nursery`
zanieb Sep 7, 2023
b09fbb9
Deprecate `RuleGroup::Nursery`
zanieb Sep 7, 2023
b374802
Fix deprecated usage in test
zanieb Sep 7, 2023
4ea6f17
Improve prefix comments
zanieb Sep 8, 2023
2cab8b7
Fix unresolved merge conflict
zanieb Sep 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clarify include_preview_rules conditional
  • Loading branch information
zanieb committed Sep 8, 2023
commit c527f6971aabc1ef2a64b548c3ede337275a9edc
4 changes: 2 additions & 2 deletions crates/ruff_workspace/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ impl Configuration {

for spec in Specificity::iter() {
let include_preview_rules = spec == Specificity::All
&& !self.preview.is_some_and(|preview| preview.is_enabled());
&& self.preview.is_some_and(|preview| preview.is_enabled());

// Iterate over rule selectors in order of specificity.
for selector in selection
Expand All @@ -486,7 +486,7 @@ impl Configuration {
.filter(|s| s.specificity() == spec)
{
for rule in selector {
if include_preview_rules && rule.is_preview() {
if !include_preview_rules && rule.is_preview() {
continue;
}
select_map_updates.insert(rule, true);
Expand Down