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

Document How To Install Additional Dictionaries #181

Open
Kurt-von-Laven opened this issue May 29, 2021 · 6 comments
Open

Document How To Install Additional Dictionaries #181

Kurt-von-Laven opened this issue May 29, 2021 · 6 comments

Comments

@Kurt-von-Laven
Copy link

Kurt-von-Laven commented May 29, 2021

This action is especially convenient for spell checking projects where installing a first Node.js package solely for the purpose of spell checking is difficult to justify. It would be ideal if it supported all of the official cspell dictionaries. I think the workaround for us is to install the medical dictionary in our workflow, and configure caching of yarn dependencies.

@Jason3S
Copy link
Contributor

Jason3S commented Jun 2, 2021

Trying to support all dictionaries would make this action huge. Maybe a way of downloading them on the fly might work.

@Kurt-von-Laven
Copy link
Author

Yeah, I have come to agree with you since filing this issue as I have realized that pulling actions down is itself one of the most expensive operations we do. I think even just showing an example of a yarn add @cspell/[email protected] or npm install @cspell/[email protected] as the preceding step in the README would actually be all that is needed?

@Kurt-von-Laven Kurt-von-Laven changed the title Support All Official cspell Dictionaries Document How To Install Additional Dictionaries Jun 7, 2021
@csd-oss
Copy link

csd-oss commented Oct 18, 2021

@Kurt-von-Laven can you please provide such an example? Cos I want to use https://www.npmjs.com/package/cspell-dict-uk-ua and I can't fully understand how to do it using this GitHub action.

@Jason3S
Copy link
Contributor

Jason3S commented Oct 19, 2021

@csd-oss,

It is better to use @cspell/dict-uk-ua - npm

Two steps are needed.

  1. Make sure the dictionary is installed:
    In your workflow add the following step before

    - name: Install dictionaries 
       run: npm install @cspell/dict-uk-ua
  2. Have a cspell.json file in your repo:

    {
      "import": ["@cspell/dict-uk-ua/cspell-ext.json"],
      "language": "en,uk"
    }

@csd-oss
Copy link

csd-oss commented Oct 19, 2021

@Jason3S Thanks! But I cspell.json file is like this in order for this to work:

{
    "import": ["@cspell/dict-uk-ua/cspell-ext.json"],
    "language":"en,uk"
}

@Jason3S Jason3S pinned this issue Aug 19, 2022
nicorikken added a commit to ospo-nl/kennisbank that referenced this issue Mar 28, 2023
GitHub Actions workflow for the CSpell spellcheck. Action from
https://github.com/streetsidesoftware/cspell-action

Additional dictionary has to be installed seperately upfront, as described in
streetsidesoftware/cspell-action#181

Signed-off-by: Nico Rikken <[email protected]>
nicorikken added a commit to ospo-nl/kennisbank that referenced this issue Mar 28, 2023
GitHub Actions workflow for the CSpell spellcheck. Action from
https://github.com/streetsidesoftware/cspell-action

Additional dictionary has to be installed seperately upfront, as described in
streetsidesoftware/cspell-action#181

Signed-off-by: Nico Rikken <[email protected]>
@guidemetothemoon
Copy link

Hi @Jason3S , I'm facing an issue with making additional dictionaries to work with GH action and in search of documentation I came across this issue. Can you please point out what I may be doing wrong here? Thanks in advance!

My workflow looks like this:

    - name: Install Node
      uses: actions/setup-node@v3
      with:
        node-version: 18
    
    - run: npm install -g @cspell/dict-es-es
    
    - name: Validate spelling
      uses: streetsidesoftware/[email protected]
      with:
        config: 'cspell.json'
        files: '**/*.md'
        inline: 'error'
        strict: true        
        incremental_files_only: true

cspell.json looks like this:

{
    "version": "0.2",
    "import": ["@cspell/dict-es-es/cspell-ext.json"],
    "language": "en,es",
----------  OMITTED ---------
}

I'm getting the following error when executing with this configuration:

Run streetsidesoftware/[email protected]
  with:
    config: cspell.json
    files: **/*.md
    inline: error
    strict: true
    incremental_files_only: true
    github_token: ***
    verbose: false
    check_dot_files: explicit
cspell-action
Pull Request
Fetch file names in commits: 6.242s
Error: Configuration
        name: Error
        msg: Failed to resolve file: "@cspell/dict-es-es/cspell-ext.json"
        stack:
Error: Failed to resolve file: "@cspell/dict-es-es/cspell-ext.json"
    at ConfigLoaderInternal.resolveFilename (/home/runner/work/_actions/streetsidesoftware/cspell-action/v5.4.0/action/lib/main_root.js:67131:33)
    at async Promise.all (index 0)
    at async ConfigLoaderInternal._mergeConfigFileWithImports (/home/runner/work/_actions/streetsidesoftware/cspell-action/v5.4.0/action/lib/main_root.js:67044:23)
    at async onReadyFixUp (/home/runner/work/_actions/streetsidesoftware/cspell-action/v5.4.0/action/lib/main_root.js:67002:24)
    at async readConfig (/home/runner/work/_actions/streetsidesoftware/cspell-action/v5.4.0/action/lib/main_root.js:75548:21)
    at async run2 (/home/runner/work/_actions/streetsidesoftware/cspell-action/v5.4.0/action/lib/main_root.js:76329:24)
    at async runLint (/home/runner/work/_actions/streetsidesoftware/cspell-action/v5.4.0/action/lib/main_root.js:76100:22)
    at async lint2 (/home/runner/work/_actions/streetsidesoftware/cspell-action/v5.4.0/action/lib/main_root.js:76701:3)
    at async checkSpelling (/home/runner/work/_actions/streetsidesoftware/cspell-action/v5.4.0/action/lib/main_root.js:76739:3)
    at async action (/home/runner/work/_actions/streetsidesoftware/cspell-action/v5.4.0/action/lib/main_root.js:76807:18)
        
Files checked: 0, Issues found: 0 in 0 files.
Done.

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

4 participants