typos icon indicating copy to clipboard operation
typos copied to clipboard

Confusing ":N" on filename typo

Open akouryy opened this issue 7 months ago • 1 comments

Description

When a typo is in a file name, the diagnostic ends with :N. Because this pattern normally refers to a line number, it looks like the typo is on that line inside the file, not in the name itself.

$ touch hello_wolrd.txt

$ cargo bin typos --version
typos-cli 1.32.0

$ cargo bin typos .
error: `wolrd` should be `world`
  --> ./hello_wolrd.txt:7

A clearer output could be:

error: `wolrd` should be `world`
  --> ./hello_wolrd.txt (filename typo)

This makes it obvious the problem is a filename typo, not a content typo.

akouryy avatar May 09 '25 06:05 akouryy

The :N is saying what column of the file name does the typo start.

I can see differentating filenames vs files but likely not in the file name reference.

epage avatar May 09 '25 14:05 epage