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

Feature Request: append words into cspell.json #4835

Open
Jason3S opened this issue Sep 18, 2023 Discussed in #4832 · 3 comments
Open

Feature Request: append words into cspell.json #4835

Jason3S opened this issue Sep 18, 2023 Discussed in #4832 · 3 comments

Comments

@Jason3S
Copy link
Collaborator

Jason3S commented Sep 18, 2023

Discussed in #4832

Originally posted by kevintraver September 13, 2023
It would be awesome if the cli could directly add to words, flagWords, or ignoreWords in cspell.json.

I am able to do this now using jq:

jq --arg words "$(cspell --words-only --unique . | sort --ignore-case | xargs -I{} echo '{}')" '.words |= . + ($words | split("\n"))' .cspell.json

It would be awesome if there was a flag when running the cli to just update cspell.json

@unlikelyzero
Copy link

unlikelyzero commented Sep 26, 2023

I could see the utility in this in the case that a core list of cspell dictionaries can't be updated in time for a PR (with failing cspell lint) to merge

@Jason3S
Copy link
Collaborator Author

Jason3S commented Sep 27, 2023

@unlikelyzero,

What use cases were you thinking of?

It has always been possible to add words to the configuration files. This enhancement is more about having the command line tool add them for you, instead of having to manually edit the local cspell config. Maybe you see a bigger need.

To support an interactive mode, it is necessary for the cli to be able to write to the config files.

@unlikelyzero
Copy link

In the event a central dictionary is maintained outside the offending repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants