Skip to content

Commit

Permalink
feat: k8s dictionary (#1705)
Browse files Browse the repository at this point in the history
* feat: k8s dictionary
* Keep the source
   Keep the source file to avoid downloading as part of CI/CD.

Co-authored-by: Carlo <carlo.ita98@gmail.com>
  • Loading branch information
Jason3S and carlocorradini committed Dec 17, 2022
1 parent 30e108c commit bf03a43
Show file tree
Hide file tree
Showing 10 changed files with 2,144 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dictionaries/k8s/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017-2022 Street Side Software <info@streetsidesoftware.nl>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
54 changes: 54 additions & 0 deletions dictionaries/k8s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Cspell K8s Dictionary

K8s dictionary for cspell.

This is a pre-built dictionary for use with cspell.

## Requirements

| Tool | Version |
| ------------------------------------------------------------------------------------------------------------------------------------ | ------- |
| [cspell](https://github.com/streetsidesoftware/cspell) | `>= 6` |
| [Code Spell Checker - Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) | `>= 2` |

## Installation

Global Install and add to cspell global settings.

```sh
npm install -g @cspell/dict-k8s
cspell link add @cspell/dict-k8s
```

## Uninstall from cspell

```sh
cspell link remove @cspell/dict-k8s
```

## Manual Installation

The `cspell-ext.json` file in this package should be added to the import section in your cspell.json file.

```javascript
{
//
"import": ["@cspell/dict-k8s/cspell-ext.json"],
//
}
```

## Building

Building is only necessary if you want to modify the contents of the dictionary. Note: Building will take a few minutes for large files.

```sh
chmod u+x ./src/build.sh
npm run build
```

## License

MIT

> Some packages may have other licenses included.
43 changes: 43 additions & 0 deletions dictionaries/k8s/cspell-ext.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// cSpell Settings
{
"id": "k8s",
"name": "k8s",
"description": "K8s dictionary for cspell.",
"readonly": true,
// List of dictionary files to add to the global list of dictionaries
"dictionaryDefinitions": [
{
"name": "k8s",
"path": "./dict/k8s.txt",
"description": "K8s dictionary for cspell."
}
],
// Dictionaries to always be used.
// Generally left empty
"dictionaries": [],
// Language Rules to apply to matching files.
// Files are matched on `languageId` and `local`
"languageSettings": [
{
// VSCode languageId. i.e. typescript, java, go, cpp, javascript, markdown, latex
// * will match against any file type.
"languageId": "yaml",
// Language local. i.e. en-US, de-AT, or ru. * will match all locals.
// Multiple locals can be specified like: "en, en-US" to match both English and English US.
"locale": "*",
// By default the whole text of a file is included for spell checking
// Adding patterns to the "includeRegExpList" to only include matching patterns
"includeRegExpList": [],
// To exclude patterns, add them to "ignoreRegExpList"
"ignoreRegExpList": [],
// regex patterns than can be used with ignoreRegExpList or includeRegExpList
// Example: "pattern": [{ "name": "mdash", "pattern": "&mdash;" }]
// This could be included in "ignoreRegExpList": ["mdash"]
"patterns": [],
// List of dictionaries to enable by name in `dictionaryDefinitions`
"dictionaries": ["k8s"],
// Dictionary definitions can also be supplied here. They are only used iff "languageId" and "locale" match.
"dictionaryDefinitions": []
}
]
}
16 changes: 16 additions & 0 deletions dictionaries/k8s/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "0.2",
"files": [
"**/*.{md,txt}",
"**/*.{yml,yaml}"
],
"dictionaries": [
"k8s"
],
"import": [
"./cspell-ext.json"
],
"words": [
"mdash"
]
}
3 changes: 3 additions & 0 deletions dictionaries/k8s/dict/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dict Directory

NOTE: This directory contains generated content. Please edit [src](../src/README.md) files.
Loading

0 comments on commit bf03a43

Please sign in to comment.