streetsidesoftware / cspell

A Spell Checker for Code!

Home Page:https://cspell.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: broken handling of filenames with special character `#`

rivy opened this issue · comments

Kind of Issue

Change in behavior or regression.

Tool or Library

cspell

Version

6+

Supporting Library

No response

OS

Windows

OS Version

10.0.19045.3324

Description

  1. Files with internal # characters are not displayed correctly for v6+.
>  echo %CD%
C:\Users\Roy\#ark\Projects\deno\dxx\repo.GH
> cspell --version
6.31.3
> cspell lint --config .vscode\cspell.json **
...
20/65 .\src\dxr.ts 56.71ms X
c:\Users\Roy\:23:7 - Unknown word (SIGBREAK)
...
  1. Dictionaries with internal # characters are not loadable for v7+.
>  echo %CD%
C:\Users\Roy\#ark\Projects\deno\dxx\repo.GH
> cspell --version
7.3.3
> cspell lint --config .vscode\cspell.json **
Dictionary Error with (#local) Error: EISDIR: illegal operation on a directory, read
CSpell: Files checked: 0, Issues found: 0 in 0 files

Prior versions (v5 and lower) appear to work correctly, loading all dictionaries and printing full filenames.

For v7, changing the dictionary filename in cspell.json to one with no # allows loading of the dictionary, but still displays incorrect file names for errors.

Steps to Reproduce

  • shown above

Expected Behavior

No response

Additional Information

No response

cspell.json

// `cspell` configuration/settings
// ref: <https://cspell.org/configuration>
// v2022.11.25 [rivy]
{
	"version": "0.2", // configuration/settings file version
	"language": "en", // language - current active spelling language
	"dictionaries": ["typescript", "#local", "acronyms+names", "jargon", "people", "shell"],
	"dictionaryDefinitions": [
		{ "name": "#local", "path": "./cspell.dictionaries/#local-project-only.wordlist.txt" },
		{ "name": "acronyms+names", "path": "./cspell.dictionaries/acronyms+names.wordlist.txt" },
		{ "name": "jargon", "path": "./cspell.dictionaries/jargon.wordlist.txt" },
		{ "name": "people", "path": "./cspell.dictionaries/people.wordlist.txt" },
		{ "name": "shell", "path": "./cspell.dictionaries/shell.wordlist.txt" }
	],
	// ignorePaths -  a list of globs to specify which files are to be ignored
	"ignorePaths": [
		"{,.,_,#,@}build/**",
		"{,.,_,#,@}coverage/**",
		"{,.,_,#,@}target/**",
		"tests/**/fixtures/**",
		"vendor/**"
	],
	// ignoreWords
	"ignoreWords": [],
	// words - list of words to be always considered correct
	"words": []
}

Code of Conduct

  • I agree to follow this project's Code of Conduct

@rivy,

Thank you for raising this issue. This is a problem with how cspell parses file names. It attempts to convert them into URLs. The # is a special character.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.