Skip to content

Commit

Permalink
feat: Add a dictionary for Docker keywords (#1117)
Browse files Browse the repository at this point in the history
* feat: Add a dictionary for Docker keywords

Co-authored-by: Jason Dent <Jason3S@users.noreply.github.com>
  • Loading branch information
tobysmith568 and Jason3S committed May 24, 2022
1 parent 9239b2c commit 50ee3c8
Show file tree
Hide file tree
Showing 11 changed files with 186 additions and 0 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
| Czech | [Zereges](https://github.com/Zereges) |
| Danish | [Viktor Hundahl Strate](https://github.com/viktorstrate) |
| Django | [canarduck](https://github.com/canarduck) |
| Docker | [Toby Smith](https://github.com/tobysmith568) |
| Elixir | [Todoroki / U-dory](https://github.com/ndac-todoroki) |
| Esperanto | [Carmen Bianca Bakker](https://github.com/carmenbianca) |
| French | [canarduck](https://github.com/canarduck) |
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Various [cspell](https://github.com/streetsidesoftware/cspell) dictionaries. Eac
- [bash](dictionaries/bash) - Bash/Shell scripts
- [cpp](dictionaries/cpp) - C and C++
- [Django](dictionaries/django) - Django framework function names
- [Docker](dictionaries/docker) - Dockerfile instructions
- [Elixir](dictionaries/elixir)
- [Go](dictionaries/golang)
- [Java](dictionaries/java)
Expand Down Expand Up @@ -76,6 +77,7 @@ Various [cspell](https://github.com/streetsidesoftware/cspell) dictionaries. Eac
| [@cspell/dict-dart](./dictionaries/dart#readme) | dart | dart | Dart dictionary for cspell. |
| [@cspell/dict-de-de](./dictionaries/de_DE#readme) | de-de | German Dictionary | German (de-DE) Dictionary. |
| [@cspell/dict-django](./dictionaries/django#readme) | django | Django Keywords | List of Python Django Framework keywords. |
| [@cspell/dict-docker](./dictionaries/docker#readme) | docker | Docker Dictionary | Docker dictionary for cspell. |
| [@cspell/dict-dotnet](./dictionaries/dotnet#readme) | dotnet | .Net Dictionary | .Net keywords. |
| [@cspell/dict-el](./dictionaries/el#readme) | el | Greek | Greek dictionary for cspell. |
| [@cspell/dict-elixir](./dictionaries/elixir#readme) | elixir | elixir | Elixir dictionary for cspell. |
Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Every attempt is made to make sure security issues are addressed as soon as poss
| cspell-dict-da_DK | 1.\* | :white_check_mark: | |
| cspell-dict-de_DE | 1.\* | :white_check_mark: | |
| cspell-dict-django | 1.\* | :white_check_mark: | |
| cspell-dict-docker | 1.\* | :white_check_mark: | |
| cspell-dict-dotnet | 1.\* | :white_check_mark: | |
| cspell-dict-el | 1.\* | :white_check_mark: | |
| cspell-dict-elixir | 1.\* | :white_check_mark: | |
Expand Down
1 change: 1 addition & 0 deletions dictionaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
| [@cspell/dict-dart](./dictionaries/dart#readme) | dart | dart | Dart dictionary for cspell. |
| [@cspell/dict-de-de](./dictionaries/de_DE#readme) | de-de | German Dictionary | German (de-DE) Dictionary. |
| [@cspell/dict-django](./dictionaries/django#readme) | django | Django Keywords | List of Python Django Framework keywords. |
| [@cspell/dict-docker](./dictionaries/docker#readme) | docker | Docker Dictionary | Docker dictionary for cspell. |
| [@cspell/dict-dotnet](./dictionaries/dotnet#readme) | dotnet | .Net Dictionary | .Net keywords. |
| [@cspell/dict-el](./dictionaries/el#readme) | el | Greek | Greek dictionary for cspell. |
| [@cspell/dict-elixir](./dictionaries/elixir#readme) | elixir | elixir | Elixir dictionary for cspell. |
Expand Down
Empty file.
21 changes: 21 additions & 0 deletions dictionaries/docker/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2022 Jason Dent <jason@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.
46 changes: 46 additions & 0 deletions dictionaries/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Cspell Docker Dictionary

Docker dictionary for cspell.

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

## Installation

Global Install and add to cspell global settings.

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

## Uninstall from cspell

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

## 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-docker/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
npm run build
```

## License

MIT

> Some packages may have other licenses included.
43 changes: 43 additions & 0 deletions dictionaries/docker/cspell-ext.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// cSpell Settings
{
"id": "docker",
"name": "Docker Dictionary",
"description": "Docker dictionary for cspell.",
"readonly": true,
// List of dictionary files to add to the global list of dictionaries
"dictionaryDefinitions": [
{
"name": "docker",
"path": "./docker-words.txt.gz",
"description": "Docker 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": "dockerfile",
// 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": ["docker"],
// Dictionary definitions can also be supplied here. They are only used iff "languageId" and "locale" match.
"dictionaryDefinitions": []
}
]
}
14 changes: 14 additions & 0 deletions dictionaries/docker/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "0.2",
"files": [
"**/*.{md,txt}"
],
"dictionaries": [
"docker"
],
"import": [
"./cspell-ext.json"
],
"words": [
]
}
18 changes: 18 additions & 0 deletions dictionaries/docker/docker-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ADD
ARG
CMD
COPY
ENTRYPOINT
ENV
EXPOSE
FROM
HEALTHCHECK
LABEL
MAINTAINER
ONBUILD
RUN
SHELL
STOPSIGNAL
USER
VOLUME
WORKDIR
39 changes: 39 additions & 0 deletions dictionaries/docker/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@cspell/dict-docker",
"version": "1.0.0",
"description": "Docker dictionary for cspell.",
"publishConfig": {
"access": "public"
},
"exports": {
".": "./cspell-ext.json",
"./cspell": "./cspell-ext.json",
"./cspell-ext.json": "./cspell-ext.json"
},
"scripts": {
"build": "cspell-tools-cli compile \"docker-words.txt\" -o .",
"test": "head -n 100 \"docker-words.txt\" | cspell -v -c ./cspell-ext.json \"--local=*\" \"--languageId=dockerfile\" stdin",
"prepublishOnly": "echo pre-publish",
"prepare": "yarn run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/streetsidesoftware/cspell-dicts.git"
},
"keywords": [
"cspell",
"docker",
"dictionary",
"spelling"
],
"author": "Jason Dent",
"license": "MIT",
"bugs": {
"url": "https://github.com/streetsidesoftware/cspell-dicts/issues"
},
"homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/docker#readme",
"files": [
"docker-words.txt.gz",
"cspell-ext.json"
]
}

0 comments on commit 50ee3c8

Please sign in to comment.