Conversation
dad0e35 to
ab4b600
Compare
7b77530 to
1e24c01
Compare
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| INP001 | 224 | 112 | 112 | 0 | 0 |
| S104 | 6 | 3 | 3 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+115 -115 violations, +0 -0 fixes in 1 projects; 43 projects unchanged)
bokeh/bokeh (+115 -115 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ examples/basic/annotations/arrow.py:1:1: INP001 File `examples/basic/annotations/arrow.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/annotations/arrow.py:1:1: INP001 File `examples/basic/annotations/arrow.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/annotations/arrowheads.py:1:1: INP001 File `examples/basic/annotations/arrowheads.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/annotations/arrowheads.py:1:1: INP001 File `examples/basic/annotations/arrowheads.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/annotations/band.py:1:1: INP001 File `examples/basic/annotations/band.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/annotations/band.py:1:1: INP001 File `examples/basic/annotations/band.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/annotations/box_annotation.py:1:1: INP001 File `examples/basic/annotations/box_annotation.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/annotations/box_annotation.py:1:1: INP001 File `examples/basic/annotations/box_annotation.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/annotations/colorbar_log.py:1:1: INP001 File `examples/basic/annotations/colorbar_log.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/annotations/colorbar_log.py:1:1: INP001 File `examples/basic/annotations/colorbar_log.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/annotations/label.py:1:1: INP001 File `examples/basic/annotations/label.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/annotations/label.py:1:1: INP001 File `examples/basic/annotations/label.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/annotations/legend.py:1:1: INP001 File `examples/basic/annotations/legend.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/annotations/legend.py:1:1: INP001 File `examples/basic/annotations/legend.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/annotations/legend_two_dimensions.py:1:1: INP001 File `examples/basic/annotations/legend_two_dimensions.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/annotations/legend_two_dimensions.py:1:1: INP001 File `examples/basic/annotations/legend_two_dimensions.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/annotations/legends_item_visibility.py:1:1: INP001 File `examples/basic/annotations/legends_item_visibility.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/annotations/legends_item_visibility.py:1:1: INP001 File `examples/basic/annotations/legends_item_visibility.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/annotations/slope.py:1:1: INP001 File `examples/basic/annotations/slope.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/annotations/slope.py:1:1: INP001 File `examples/basic/annotations/slope.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/annotations/whisker.py:1:1: INP001 File `examples/basic/annotations/whisker.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/annotations/whisker.py:1:1: INP001 File `examples/basic/annotations/whisker.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/areas/stacked_area.py:1:1: INP001 File `examples/basic/areas/stacked_area.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/areas/stacked_area.py:1:1: INP001 File `examples/basic/areas/stacked_area.py` is part of an implicit namespace package. Add an `__init__.py`. + examples/basic/axes/logplot.py:1:1: INP001 File `examples/basic/axes/logplot.py` is part of an implicit namespace package. Add an `__init__.py`. - examples/basic/axes/logplot.py:1:1: INP001 File `examples/basic/axes/logplot.py` is part of an implicit namespace package. Add an `__init__.py`. ... 199 additional changes omitted for rule INP001 + tests/unit/bokeh/command/subcommands/test_serve.py:540:20: S104 Possible binding to all interfaces - tests/unit/bokeh/command/subcommands/test_serve.py:540:20: S104 Possible binding to all interfaces + tests/unit/bokeh/test_server.py:51:48: S104 Possible binding to all interfaces - tests/unit/bokeh/test_server.py:51:48: S104 Possible binding to all interfaces + tests/unit/bokeh/test_server.py:52:34: S104 Possible binding to all interfaces - tests/unit/bokeh/test_server.py:52:34: S104 Possible binding to all interfaces ... 198 additional changes omitted for project
Changes by rule (2 rules affected)
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| INP001 | 224 | 112 | 112 | 0 | 0 |
| S104 | 6 | 3 | 3 | 0 | 0 |
|
Oh right. We will visit the strings inside a f-string and try to change that. I'll fix this later. |
|
Oops, approved before I saw the ecosystem changes. |
42bf089 to
d30dc29
Compare
CodSpeed Performance ReportMerging #10312 will not alter performanceComparing Summary
|
ab4b600 to
67810b6
Compare
d30dc29 to
b096569
Compare
67810b6 to
1ef5e95
Compare
b096569 to
e2ae5a0
Compare
e2ae5a0 to
677178a
Compare
| .indexer() | ||
| .fstring_ranges() | ||
| .outermost(string_like.start()) | ||
| .is_some_and(|outer| outer.start() < string_like.start() && string_like.end() < outer.end()) |
There was a problem hiding this comment.
We only want to ignore strings which are strictly inside another f-string which is not what TextRange::contains_range does.
|
Weird, this PR doesn't include any change to the rules detected in the ecosystem checks |
| continue; | ||
| } | ||
| pub(crate) fn check_string_quotes(checker: &mut Checker, string_like: StringLike) { | ||
| // If the string is part of a f-string, ignore it. |
There was a problem hiding this comment.
Nit: I noticed that this rule performs quiet many allocations even in the happy path where the quotes match (collects the text ranges, collects the trivia, etc).
I wonder if we could add a fast path (you may need to wait for @AlexWaygood's changes) where we first test if:
- If it's a docstring, the quote matches the configured docstring quotes and if so, exits.
- For "regular strings", early exit if the configured inline or multiline quotes are the same and the string quotes match.
There was a problem hiding this comment.
Yeah, I had something similar in mind which is to completely rewrite this rule by only using the string flags which I think should be possible. I'll open a tracking issue for it. Thanks for the suggestion!
Edit: #10456
677178a to
743c772
Compare
Summary
Continuing with #7595, this PR moves the
Q001,Q002,Q003rules to the AST based checker.Test Plan
Make sure all of the existing test cases pass and verify there are no ecosystem changes.