Skip to content

tab-size = 0 leads to panic. #6423

@Nuno-Mota

Description

@Nuno-Mota

Hi.

Setting tab-size = 0 creates a panic (it's unsurprising that an error occurs, but it should probably be handled gracefully):
Note that this was tested using a pyproject.toml configuration file, for ruff 0.0.282.

warning: Linting panicked test.py: This indicates a bug in `ruff`. If you could open an issue at:

https://github.com/astral-sh/ruff/issues/new?title=%5BLinter%20panic%5D

with the relevant file contents, the `pyproject.toml` settings, and the following stack trace, we'd be very appreciative!

panicked at 'attempt to calculate the remainder with a divisor of zero', crates/ruff/src/line_width.rs:90:49
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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconfigurationRelated to settings and configurationhelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions