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

Option --wordsOnly not working with cspell 5.2.4 #1000

Closed
4 of 18 tasks
vikivivi opened this issue Feb 25, 2021 · 4 comments · Fixed by #1002
Closed
4 of 18 tasks

Option --wordsOnly not working with cspell 5.2.4 #1000

vikivivi opened this issue Feb 25, 2021 · 4 comments · Fixed by #1002

Comments

@vikivivi
Copy link

Info

Kind of Issue

  • runtime - command-line tools
  • building / compiling
  • security
  • change in behavior
  • crash / error

Which Tool or library

  • cspell -- the command-line spelling tool
  • cspell-tools -- used for building dictionary files
  • cspell-lib -- library that does the actual spell checking.
  • cspell-trie -- tool for working with trie files.

Which Version

Version: cspell 5.2.4 with node-v14.16.0-linux-x64.tar.xz from nodejs.org.
All other node_modules: cspell is freshly installed today 25-Feb-2021.

Issue with supporting library?

  • No
  • cspell-glob -- library for matching glob patterns
  • cspell-io -- thin file i/o library
  • cspell-trie-lib - trie lib
  • cspell-trie2-lib - trie lib alternate format

OS:

  • Macos
  • Linux
  • Windows
  • Other

version:

Ubuntu 20.04.2 LTS (Fully upgraded using apt-get dist-upgrade)

Bug Description

Describe the bug

Option --wordsOnly not working with cspell 5.2.4

To Reproduce

Steps to reproduce the behavior:

$ cat hello.c
#include <stdio.h>

int main() {
    /* Currently demostrate thisisbadspell */
    printf("Demostrate misspell!");
    printf("Demonstrate correct spelling!");
    return 0;
}
  • Option --wordsOnly crashes. It is working correctly previously but unable to recall the working version.
$ cat hello.c | /home/user/bin/cspell/node_modules/.bin/cspell lint -c /home/user/bin/cspell/cspell.json --no-progress --no-summary --wordsOnly stdin
Error: Found extraneous } in Chalk template literal
    at /home/user/bin/cspell/node_modules/chalk/source/templates.js:115:11
    at String.replace (<anonymous>)
    at module.exports (/home/user/bin/cspell/node_modules/chalk/source/templates.js:105:12)
    at chalkTag (/home/user/bin/cspell/node_modules/chalk/source/index.js:219:9)
    at chalk.template (/home/user/bin/cspell/node_modules/chalk/source/index.js:42:38)
    at formatIssue (/home/user/bin/cspell/node_modules/cspell/dist/app.js:347:12)
    at CSpellApplicationConfiguration.issueEmitter [as logIssue] (/home/user/bin/cspell/node_modules/cspell/dist/app.js:50:21)
    at /home/user/bin/cspell/node_modules/cspell/dist/application.js:114:71
    at Array.forEach (<anonymous>)
    at processFile (/home/user/bin/cspell/node_modules/cspell/dist/application.js:114:48)

$ /home/user/bin/cspell/node_modules/.bin/cspell lint -c /home/user/bin/cspell/cspell.json --no-progress --no-summary --wordsOnly ./hello.c 
Error: Found extraneous } in Chalk template literal
    at /home/user/bin/cspell/node_modules/chalk/source/templates.js:115:11
    at String.replace (<anonymous>)
    at module.exports (/home/user/bin/cspell/node_modules/chalk/source/templates.js:105:12)
    at chalkTag (/home/user/bin/cspell/node_modules/chalk/source/index.js:219:9)
    at chalk.template (/home/user/bin/cspell/node_modules/chalk/source/index.js:42:38)
    at formatIssue (/home/user/bin/cspell/node_modules/cspell/dist/app.js:347:12)
    at CSpellApplicationConfiguration.issueEmitter [as logIssue] (/home/user/bin/cspell/node_modules/cspell/dist/app.js:50:21)
    at /home/user/bin/cspell/node_modules/cspell/dist/application.js:114:71
    at Array.forEach (<anonymous>)
    at processFile (/home/user/bin/cspell/node_modules/cspell/dist/application.js:114:48)
$ grep version ~/bin/cspell/node_modules/chalk/package.json
  "version": "4.1.0",

Expected behavior

--wordsOnly should work as expected. Not sure am I the only one having this issue.

Screenshots

See above console output.

Additional context

Add any other context about the problem here.

cspell.json

{
    "version": "0.1",
    "language": "en",
    "words": [
    ],
    "flagWords": [
    ],
    "enableFiletypes": [
        "shellscript"
    ],
    "ignorePaths": ["node_modules/**"],
    "dictionaries": ["custom"],
    "dictionaryDefinitions": [
        { "name": "custom", "path": "/home/user/bin/scripts/data/dictionary-aspell-personal.txt"}
    ]
}

Example Repository (Optional)

An example repository makes things easier to debug.

@Jason3S
Copy link
Collaborator

Jason3S commented Feb 25, 2021

@vikivivi Thank you. I'll take a look.

Jason3S added a commit that referenced this issue Feb 25, 2021
@Jason3S Jason3S linked a pull request Feb 25, 2021 that will close this issue
Jason3S added a commit that referenced this issue Feb 25, 2021
@Jason3S
Copy link
Collaborator

Jason3S commented Feb 25, 2021

@vikivivi

Would you please verify that version 5.3.0-alpha.4 works for you?

npm i -g cspell@next

@vikivivi
Copy link
Author

@Jason3S , using cspell 5.3.0-alpha.4 with option --wordsOnly is working on my system now. Thank you. This issue can be closed now.

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants