Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@

# Error (89 characters)
"shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:aaaa" # type: ignore

# OK (88 characters)
"shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:aaa" # pyrefly: ignore[missing-attribute]

# Error (89 characters)
"shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:aaaa" # pyrefly: ignore[missing-attribute]
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,14 @@ E501 Line too long (89 > 88)
10 | # Error (89 characters)
11 | "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:aaaa" # type: ignore
| ^
12 |
13 | # OK (88 characters)
|

E501 Line too long (89 > 88)
--> E501_3.py:17:89
|
16 | # Error (89 characters)
17 | "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:" + "shape:aaaa" # pyrefly: ignore[missing-attribute]
| ^
|
3 changes: 2 additions & 1 deletion crates/ruff_python_trivia/src/pragmas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/// assert!(ruff_python_trivia::is_pragma_comment("# nosec B602, B607"));
/// assert!(ruff_python_trivia::is_pragma_comment("# isort: off"));
/// assert!(ruff_python_trivia::is_pragma_comment("# isort: skip"));
/// assert!(ruff_python_trivia::is_pragma_comment("# pyrefly: ignore[missing-attribute]"));
/// ```
pub fn is_pragma_comment(comment: &str) -> bool {
let Some(content) = comment.strip_prefix('#') else {
Expand All @@ -26,5 +27,5 @@ pub fn is_pragma_comment(comment: &str) -> bool {
// Case-sensitive match against a variety of pragmas that _do_ require a trailing colon.
trimmed
.split_once(':')
.is_some_and(|(maybe_pragma, _)| matches!(maybe_pragma, "isort" | "type" | "pyright" | "pylint" | "flake8" | "ruff" | "ty"))
.is_some_and(|(maybe_pragma, _)| matches!(maybe_pragma, "isort" | "type" | "pyright" | "pyrefly" | "pylint" | "flake8" | "ruff" | "ty"))
}
Loading