Skip to content

Better shorthand reply parsing for the typo of a space after a number #15240

@talflon

Description

@talflon

What problem has occurred? What issues has it caused?

Shorthand reply parsing doesn't handle adding a space after a number well, like in:

sd 2 k

instead of the correct

sd 2k

On the one hand, this is a mistake according to the documentation, so we can blame the user. On the other hand:

  • this is probably very easy to fix
  • currently it crashes Smokey if someone types this. It doesn't consider it the same as sd 2- k, it just provokes an uncaught IndexError.

What would you like to happen/not happen?

Let's not crash Smokey. I'd like to do that by both:

  1. Not processing the user's attempted commands in this case, treating this as an error instead
  2. Catching all parsing exceptions in dispatch_shorthand_command, not just some of them

I'd additionally like to give a useful feedback message to the user, mentioning that they can't put a space after a number.

Alternative

Another way this could be handled would be to allow the space, treating it the same as if there were no space. That would take slightly more coding. Probably still easy. Anyone prefer that?

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions