Giter VIP home page Giter VIP logo

cspell's People

Contributors

abdusabri avatar aimagic avatar bisubus avatar caaatisgood avatar coliff avatar dakotajang avatar denysvuika avatar dependabot[bot] avatar dflock avatar dsanders11 avatar github-actions[bot] avatar jason-rev avatar jason3s avatar jrylan avatar lostintangent avatar mad-gooze avatar matt9ucci avatar naveensrinivasan avatar nschonni avatar ollelauribostrom avatar orta avatar pzmarzly avatar rasa avatar rivy avatar roman-petrov avatar scottrudiger avatar snyk-bot avatar street-side-software-automation[bot] avatar zamiell avatar zo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cspell's Issues

No spell-checker:disable-line ?

Hello and thank you for creating this cSpell! ๐Ÿ™‡โ€โ™‚๏ธ

All linters I know have an option to ignore a single line. I didn't find such a feature in cSpell. Have you considered it?

Make URI schema filtering configuable

At the moment, cspell supports a couple of URI schemas when filtering files to spell check.

These are file, untitled, and vsls (Thanks to #28).

The vsls pull request makes it clear that this setting needs to be configuration based and not hard-coded.

Possible to bypass string values?

Is it possible to bypass string variables for this spell checker?

currently this fails, but it shouldn't. I have to do an ignore every time, which is very annoying:

var URL = 'https://github.com/Jason3S/cspell/issues/26#issuecomment-383315831'

I want to spell check variable names, function names and all that etc,

I am not too fussed about the spelling of string variables.

BUT, I would like to spell check .spec.ts

So it should still find it('should fix spelin erros')

Edit: I have found this, which disables ALL stings:

https://github.com/Jason3S/cspell/blob/master/samples/comments_only/cpp_strings_and_comments.cspell.json

    "ignoreRegExpList": [
        "string"
     ]

config file is never loaded and no errors are mentioned

I tried to create a config file to add some words to it but cspell didn't load it, even if the filename was in current director, even if I tried cspell -c cspell.json cspell.json.

I even tried --debug mode, hopping that this would show more info but no message regarding config file is displayed.

Tested on MacOS, with cspell 2.1.11

Update: it seems that even the smallest syntax error in config file is totally and silently ignored, like and additional command after the last element of a list.

... considering that list of words is better kept as a sorted list, you can imagine a recurring issue.

unable to use compound words

I discovered that cspell is finding java arguments like -Djenkins as words and I attempted to make it recognize them by adding D and jenkins as words and adding "allowCompoundWords": true, inside cspell.json.

Still, this didn't work and these words are still reported.

I do not want to add each of them in the dictionary as the list would grow too fast.

What is the trick that needs to be done to bypass this case?

VSCode plugin reports more errors than command line for same file

When I run cspell I always get more errors reported in VSCode than I do on the command-line, whether the command-line includes wildcards or just a single file. The VSCode list is always a superset of the command-line list.

Example:
VSCode Output:
VSCode output
Command-line Output:
Command-line output

Further notes:

  • I have just a single cspell.json file in my project, at the root, which is the directory from which I run the command-line invocation.
  • If I add an exclusion to that cspell.json file, it is immediately reflect in VSCode--that error goes away. And if I rerun cspell on the command-line, that error goes away.
  • Running on macOS High Sierra
  • Cspell command-line version: 3.0.2
  • VSCode plugin version: "Code Spell Checker 1.6.10"

linter output format is not standardized

The standard format for linters is file-path:line:column but cspell is using file-path[line, column], making it incompatible with lots of tools that rely on this.

For example iTerm2 fails to identify correct filename and the semantic-history feature get broken before it tries to open file-path[line instead of file-path.

Unable to run cspell due to stale files somewhere

I've long been using cspell as a plugin for VSCode and it works well--thanks! Today I installed the command-line version (npm install -g cspell) and then tried this:

$ cspell --help
-bash: /Users/msorens/code/git/proj-ui/node_modules/cspell/dist/app.js: No such file or directory

I have tried sitting in different directories, but always the same error. That path reference is to an old git repo I have not even used for months. What is telling it to try to look there...?

ignorePaths not working(or I am doing something stupid)

I want to ignore all of my test files. This is what my config looks like:

{
    "version": "0.1",
    "words": [
        "blockchain", "stuffs", "moob"
    ],
    "ignoreRegExpList": ["\\woob*\\w"],
    "flagWords": [
        "stuff"
    ],
    "ignorePaths": [
        "node_modules/**",
        ".git",
        "*Tests.js"
    ],
    "minWordLength": 2
}

The "*Tests.js" does not seem to do the trick. Any suggestions?

ability to load wordlist from simple plaintext file

Keeping a list of words inside a JSON file sounds more of a sadistic task. If the wordlist would be loaded from a simple plaintext file, it could also be re-used by other tools/spellers.

Config file should have an option to mention the filename containing the wordlist.

Maybe in the future this file could also be an URL, as in this case it would allow you to share a wordlist across multiple repositories instead of having to copy it.

How to disable/remove an entry from the default value for ignoreRegExpList

The default value of ignoreRegExpList for HTML includes the href pattern so that cspell doesn't check the contents of the href attribute of links. However, I need it to do so. How can I disable the default ignore pattern?

BTW, it's a really questionable default value, especially if it's not disableable.

Sends output to error stream even when no errors are found

When cSpell returns that there are no errors in the files it has checked, it still sends an output to the error stream.

https://github.com/Jason3S/cspell/blob/d66356d72721536e5c6a96a1d19046632cf7d394/src/app.ts#L77

This gives a false negative when for example using it in a CI test.
See a PowerShell Pester test run here: https://ci.appveyor.com/project/johlju/certificatedsc/build/2.3.45.0#L465

Is it possible to override this behavior? Either a parameter so that it does not generate an error at all (if the output contains rows, errors were found), or a parameter to only send output to the error stream when an error was detected. In the later, if no errors was detected, I would be good to output the string in the stdout.

Ignore protocol vscode://

Hi!

cSpell is showing me a lot of unwanted errors.

I think cSpell should avoid to check files in protocols like git://, vscode:// or memory:// and just keep checking untitled:// and real file paths.

screenshot_20170808_142401

BTW, Thanks for this awesome extension! ๐Ÿ˜„

Cannot set multiple languages

For some reason I can ask VSCode to use two languages ("de,en" in my case), but when I am using the package directly in CI, it set the first language only.

Need html-reporter

Jason, what about html reporter? Do you plan to implement this feature?

The default search for cspell.json is finding nested cspell.json files.

cspell -v "**/*.ts"
Exclusion Globs: 
    Glob: dictionaries/** from cSpell.json
    Glob: migrated_dictionaries/** from cSpell.json
    Glob: node_modules/** from cSpell.json
    Glob: coverage/** from cSpell.json
    Glob: .git/** from cSpell.json
    Glob: dist/** from cSpell.json
    Glob: package.json from cSpell.json
    Glob: **/package.json from cSpell.json
    Glob: **/.cspell.json from cSpell.json
    Glob: .vscode/** from cSpell.json
    Glob: node_modules/** from default

rxjs_1.of is not a function

I get this error when using cspell: 3.0.1:

cspell src/**/*.ts

rxjs_1.of is not a function

npm ERR! Linux 4.4.0-101-generic
npm ERR! argv "/home/travis/.nvm/versions/node/v7.10.1/bin/node" "/home/travis/.nvm/versions/node/v7.10.1/bin/npm" "run" "spell"
npm ERR! node v7.10.1
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] spell: `cspell src/**/*.ts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] spell script 'cspell src/**/*.ts'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mmm-awesome-alexa package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cspell src/**/*.ts
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs mmm-awesome-alexa
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls mmm-awesome-alexa
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /home/travis/.npm/_logs/2018-04-29T10_50_40_294Z-debug.log

Integration with VS Code version

I read in #48 that:

The command line version cannot pick up the settings from VS Code.

But it actually would be nice having both of them acting together. I think at least words in the local project dictionary (in .vscode/settings.json with key "cSpell.words") should be considered by the CLI version.

failure to exclude urls from rst files

I had this sequence below which reports Fjira as an unknown word and I know no way to avoid it:

<dash-feed://https%3A%2F%2Fjira.readthedocs.io%2Fen%2Flatest%2Fjira.xml>`_ format.

I didn't check the code but I have reasons to believe that probably URL support had the protocol hardcoded and thus failing to recognise it as a URI/URL.

Does not detect misspelt words

Fails to detect obviously misspelt words, such as:
hellosd
applesq
bananasa
respectss

Tested version 1.0.1 on Windows.
Am I missing something?

ability to spell from stdin

I would like to spellcheck last commit message which means that cspell should be able to spellcheck from stdin with something like echo "some spell missstake!" | cspell

If cspell would recognise stdin presence, it would easily be used to spell commit messages or other things that are not stored on file on disk.

cspell fails to install using nodeenv

While trying to enable cspell to be used a pre-commit hook, I faces a new issue, failure to install when doing:

pip install --user nodeenv
git clone https://github.com/Jason3S/cspell
cd cspell
nodeenv nenv
. nenv/bin/activate
npm install -g .

The last command fails with:

$ npm install -g .                                                                                                                                                                                          [21:18:12]
npm ERR! path /home/ssbarnea/cspell/nenv/lib/node_modules/cspell/dist/app.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/home/ssbarnea/cspell/nenv/lib/node_modules/cspell/dist/app.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ssbarnea/.npm/_logs/2018-07-04T21_18_18_526Z-debug.log
(nenv)FAIL: 254

default color scheme is hurts eyes

The default colored output is causing serious difficulties in reading the output mainly due to a combination of use of bold, red and green. This happen even for those that are not color blind.

Colors are good as they can increase lability of the text but in this case I think they work against it.

I propose a simplification

  • avoid using bold, at all
  • avoid using green for filenames, use normal/default ANSI color
  • use red only for the error word.
  • optional: use dark color for details like line and column numbers.

cspell-colors

Use a larger dictionary

Words such as customizer fail. Using a larger English dictionary that supports word variations would help to reduce the many false positives I am seeing.

enable cspell to be used as a pre-commit hook

pre-commit is a framework for managing git pre-commit hooks, one that allow project maintainers to define hooks that can be reused by all project contributors.

In most cases enabling support for a new tool is done by creating a simple hook definition file in the root of the repository. This is enough to enable users to consume that tool.

Please note that I am already working on testing this and once is ready I should be able to make pull request to activate it. Still, there are few things I need to sort out before making the PR, one of them was the recently fixed bug related to installation.

Should dont (vs don't) be reported as a mistake when part of a compound word?

cspell is flagging 'dont' in dontRestart as an error. This started happening after I upgraded from 2.x to 3.x.

cSpell: 3.1.3
node: 10.3.0


node_modules/.bin/cspell -v index.js
cspell;
Date: Sun, 24 Jun 2018 12:51:54 GMT
Options:
    verbose:   Yes
    config:    {cspell.json,.cspell.json}
    exclude:   node_modules/**
    files:     index.js
    wordsOnly: No
    unique:    No

Config Files Found:
    cspell.json

Exclusion Globs:
    Glob: node_modules/** from default

Checking: index.js, File type: javascript, Language: en ... Issues: 3
Dictionaries Used: gue, en_us, companies, softwareTerms, misc, filetypes, typescript, node, npm
index.js:319:23 - Unknown word (dont)
index.js:330:26 - Unknown word (dont)
index.js:351:16 - Unknown word (dont)
CSpell: Files checked: 1, Issues found: 3 in 1 files

config (.spelling has a handfull of project specific non-words and some things like isarray etc)

{
  "language": "en",
  "allowCompoundWords": true,
  "dictionaries": ["gue"],
  "dictionaryDefinitions": [
    {"name": "gue", "path": "./.spelling"}
  ]
}

Can't set language via config file

cspell: 3.1.0
node: 10.3.0

Here's the stripped down contents of my cspell.json

{
  "language": "en"
}

Verbose output


node_modules/.bin/cspell -v index.js |less -r

cspell;
Date: Sun, 24 Jun 2018 04:00:52 GMT
Options:
    verbose:   Yes
    config:    {cspell.json,.cspell.json}
    exclude:   node_modules/**
    files:     index.js
    wordsOnly: No
    unique:    No

Config Files Found:
    cspell.json

Exclusion Globs:
    Glob: node_modules/** from default

Checking: index.js, File type: javascript, Language:  ... Issues: 220
Dictionaries Used: companies, softwareTerms, misc, filetypes, typescript, node, npm

If I set --local en on the command line it works as expected. I've tried using local instead of language in the config file, and I've tried with no config file.

Unexpected token (support for older node version)

Hi Jason,

Great library and really good to see you using TS. We're using cspell as part of our CI pipeline and for one project we are deploying to AWS Lambda. That forces us to build using node v4.3 which doesn't support the ES2015 output you are targeting in your TS config.

This results at build in

/home/ubuntu/email-adapter/node_modules/cspell/dist/app.js:10
    const { uri = '', row, col, text } = issue;
          ^

SyntaxError: Unexpected token {

I think older versions could be supported by targeting ES3 - unless of course you're using any ES2015+specific features that TS doesn't account for?

Thanks,

ignorePaths not working for nested projects?

I have a project where the NPM project is nested in the folder UI/Dashboard. I would like to ignore all JSON files as it is not possible to use pragma directives in comments in JSON files. The cSpell.json file created by the extension when using "add to project dictionary". It is at the top level under the .vscode folder.

I've tried: "**/.json", "UI/Dashboard/tslint.json", "UI/Dashboard/.json", etc. I've also tried copying the cSpell.json to the .vscode folder under UI/Dashboard but nothing seems to work.

Is there a defect?

Summary is emitted via stderr

Sorry for the flood of issues ... this one is very non urgent (and opinionated) so feel free to ignore ...

The summary line

CSpell: Files checked: 16, Issues found: 0 in 0 files

Is emitted via stderr wether or not there were any errors found in the spell check. IMO stderr when there are errors and stdout for non errored runs. A silent when no errors option would work as well. I'm happy to figure it out and submit a PR if you're interested.

SyntaxError: Unexpected token

$ npm install -g cspell
$ cspell -h
/usr/lib/node_modules/cspell/dist/app.js:85
.action(async (files, options) => {
^

SyntaxError: Unexpected token (
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)

$ cat /etc/fedora-release
Fedora release 26 (Twenty Six)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.