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

[Linter panic] IPykernel Debugger Module #5621

Closed
blink1073 opened this issue Jul 8, 2023 · 3 comments · Fixed by #5623
Closed

[Linter panic] IPykernel Debugger Module #5621

blink1073 opened this issue Jul 8, 2023 · 3 comments · Fixed by #5623
Assignees
Labels
bug Something isn't working

Comments

@blink1073
Copy link

blink1073 commented Jul 8, 2023


[tool.ruff]
target-version = "py37"
line-length = 100
select = [
  "A",
  "B",
  "C",
  "DTZ",
  "E",
  "EM",
  "F",
  "FBT",
  "I",
  "ICN",
  "ISC",
  "N",
  "PLC",
  "PLE",
  "PLW",
  "Q",
  "RUF",
  "S",
  "SIM",
  "T",
  "TID",
  "UP",
  "W",
  "YTT",
]
ignore = [
  # Allow non-abstract empty methods in abstract base classes
  "B027",
  # Ignore McCabe complexity
  "C901",
  # Allow boolean positional values in function calls, like `dict.get(... True)`
  "FBT003",
  # Use of `assert` detected
  "S101",
  # Line too long
  "E501",
  # Relative imports are banned
  "TID252",
  # Boolean ... in function definition
  "FBT001", "FBT002",
  # Module level import not at top of file
  "E402",
  # A001/A002/A003 .. is shadowing a python builtin
  "A001", "A002", "A003",
  # Possible hardcoded password
  "S105", "S106",
  # Q000 Single quotes found but double quotes preferred
  "Q000",
  # N806 Variable `B` in function should be lowercase
  "N806",
  # T201 `print` found
  "T201",
  # N802 Function name `CreateWellKnownSid` should be lowercase
  "N802", "N803",
  # C408 Unnecessary `dict` call (rewrite as a literal)
  "C408",
  # N801 Class name `directional_link` should use CapWords convention
  "N801",
  # SIM105 Use `contextlib.suppress(ValueError)` instead of try-except-pass
  "SIM105",
  # S110 `try`-`except`-`pass` detected
  "S110",
]
unfixable = [
  # Don't touch print statements
  "T201",
  # Don't touch noqa lines
  "RUF100",
]

[tool.ruff.per-file-ignores]
# B011 Do not call assert False since python -O removes these calls
# F841 local variable 'foo' is assigned to but never used
# C408 Unnecessary `dict` call
# E402 Module level import not at top of file
# T201 `print` found
# B007 Loop control variable `i` not used within the loop body.
# N802 Function name `assertIn` should be lowercase
# F841 Local variable `t` is assigned to but never used
# EM101 Exception must not use a string literal, assign to variable first
# PLR2004 Magic value used in comparison
# PLW0603 Using the global statement to update ...
# PLW2901 `for` loop variable ...
# PLC1901 `stderr == ""` can be simplified to `not stderr` as an empty string is falsey
# B018 Found useless expression. Either assign it to a variable or remove it.
# S603 `subprocess` call: check for execution of untrusted input
"ipykernel/tests/*" = ["B011", "F841", "C408", "E402", "T201", "B007", "N802", "F841", "EM101",
    "EM102", "EM103", "PLR2004", "PLW0603", "PLW2901", "PLC1901", "B018", "S603"]
  • The current Ruff version (ruff --version). 276
panicked at 'range start index 2 out of range for slice of length 1', crates/ruff/src/rules/isort/block.rs:159:36
Backtrace:    0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: <unknown>
  15: <unknown>
  16: <unknown>
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: <unknown>
  21: <unknown>
  22: <unknown>
  23: <unknown>
  24: <unknown>
  25: <unknown>
  26: <unknown>
@charliermarsh
Copy link
Member

Thanks, will take a look!

@charliermarsh charliermarsh self-assigned this Jul 8, 2023
@charliermarsh charliermarsh added the bug Something isn't working label Jul 8, 2023
@charliermarsh
Copy link
Member

If you need an immediate workaround, you can remove the # isort: skip comments. But I'll make sure this is fixed in the next release.

@blink1073
Copy link
Author

We're fine to ignore the warning for now, thanks!

charliermarsh added a commit that referenced this issue Jul 8, 2023
## Summary

We're doing some unsafe accesses to advance these iterators. It's easier
to model these as actual iterators to ensure safety everywhere. Also
added some additional test cases.

Closes #5621.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants