Skip to content

Commit

Permalink
dev: Adjust Docker dictionary conf (#1118)
Browse files Browse the repository at this point in the history
* dev: Adjust Docker dictionary conf
* Add a sample Dockerfile
  • Loading branch information
Jason3S authored May 24, 2022
1 parent 50ee3c8 commit 761d733
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 40 deletions.
5 changes: 5 additions & 0 deletions dictionaries/docker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change Log

## 1.0.0

- Initial Release
16 changes: 9 additions & 7 deletions dictionaries/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ 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.
Manual installation is useful if you want to include this dictionary as part of your CI/CD lint process.

```
npm i @cspell/dict-docker
```

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

```javascript
{
Expand All @@ -31,13 +37,9 @@ The `cspell-ext.json` file in this package should be added to the import section
}
```

## Building
# Dictionary Development

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
```
See: [How to Create a New Dictionary](https://github.com/streetsidesoftware/cspell-dicts#how-to-create-a-new-dictionary)

## License

Expand Down
26 changes: 8 additions & 18 deletions dictionaries/docker/cspell-ext.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,33 @@
// cSpell Settings
{
"id": "docker",
"version": "0.2",
"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": "—" }]
// 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": []
}
],
"globRoot": "${cwd}",
"overrides": [
{
"filename": "**/Dockerfile",
"languageId": "dockerfile"
}
]
}
15 changes: 4 additions & 11 deletions dictionaries/docker/cspell.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
{
"version": "0.2",
"files": [
"**/*.{md,txt}"
],
"dictionaries": [
"docker"
],
"import": [
"./cspell-ext.json"
],
"words": [
]
"files": ["**/*.{md,txt}", "**/Dockerfile"],
"ignorePaths": ["src"],
"dictionaries": [],
"import": ["./cspell-ext.json"]
}
11 changes: 8 additions & 3 deletions dictionaries/docker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"./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",
"build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 cspell-tools-cli compile \"src/docker-words.txt\" -o .",
"test": "head -n 1000 \"src/docker-words.txt\" | cspell -v -c ./cspell-ext.json \"--local=*\" \"--languageId=dockerfile\" stdin",
"prepublishOnly": "echo pre-publish",
"prepare": "yarn run build"
},
Expand All @@ -22,6 +22,7 @@
},
"keywords": [
"cspell",
"cspell-ext",
"docker",
"dictionary",
"spelling"
Expand All @@ -32,8 +33,12 @@
"url": "https://github.com/streetsidesoftware/cspell-dicts/issues"
},
"homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/docker#readme",
"devDependencies": {},
"dependencies": {},
"files": [
"docker-words.txt.gz",
"cspell-ext.json"
"cspell-ext.json",
"*.js",
"*.d.ts"
]
}
8 changes: 8 additions & 0 deletions dictionaries/docker/source/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# syntax=docker/dockerfile:1
FROM node:12-alpine
RUN apk add --no-cache python2 g++ make
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "src/index.js"]
EXPOSE 3000
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"bugs": {
"url": "https://github.com/streetsidesoftware/cspell-dicts/issues"
},
"homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/packages/<%= name %>#readme",
"homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/<%= name %>#readme",
"devDependencies": {},
"dependencies": {},
"files": [
Expand Down

0 comments on commit 761d733

Please sign in to comment.