diff --git a/dictionaries/terraform/cspell-ext.json b/dictionaries/terraform/cspell-ext.json index ce1544feac4..5bc3f884d1d 100644 --- a/dictionaries/terraform/cspell-ext.json +++ b/dictionaries/terraform/cspell-ext.json @@ -1,11 +1,9 @@ -// cSpell Settings { "id": "terraform", "version": "0.2", "name": "Terraform", "description": "Terraform dictionary for cspell.", "readonly": true, - // List of dictionary files to add to the global list of dictionaries "dictionaryDefinitions": [ { "name": "terraform", @@ -13,32 +11,16 @@ "description": "Terraform 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 `locale` "languageSettings": [ { - // VSCode languageId. i.e. typescript, java, go, cpp, javascript, markdown, latex - // * will match against any file type. - "languageId": "terraform", - // Language locale. i.e. en-US, de-AT, or ru. * will match all locales. - // Multiple locales can be specified like: "en, en-US" to match both English and English US. + "languageId": "terraform,tfvars", "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": ["terraform"], - // Dictionary definitions can also be supplied here. They are only used iff "languageId" and "locale" match. - "dictionaryDefinitions": [] + "dictionaries": ["terraform"] } - ] + ], + "enableFiletypes": ["terraform"], + "overrides": [{ "filename": "**/*.tf", "languageId": "terraform" }] } diff --git a/dictionaries/terraform/cspell-tools.config.yaml b/dictionaries/terraform/cspell-tools.config.yaml index 87c0c68791c..feddeb8ffa7 100644 --- a/dictionaries/terraform/cspell-tools.config.yaml +++ b/dictionaries/terraform/cspell-tools.config.yaml @@ -7,6 +7,6 @@ targets: maxDepth: 1 # This is set to 1 to prevent initial builds from taking too long. format: 'plaintext' targetDirectory: './dict' - generateNonStrict: 'false' + generateNonStrict: false compress: false checksumFile: true diff --git a/dictionaries/terraform/cspell.json b/dictionaries/terraform/cspell.json index 3720a7cf79a..4fcb4c46472 100644 --- a/dictionaries/terraform/cspell.json +++ b/dictionaries/terraform/cspell.json @@ -3,10 +3,12 @@ "files": [ "**/*.{md,txt}" ], - "dictionaries": [ - "terraform" - ], "import": [ "./cspell-ext.json" - ] + ], + "overrides": [{ + "filename": "**/*.{md,txt}", + "dictionaries": ["terraform"] + }], + "words": ["tfvars"] } diff --git a/dictionaries/terraform/package.json b/dictionaries/terraform/package.json index 6946cf59722..390d87f6945 100644 --- a/dictionaries/terraform/package.json +++ b/dictionaries/terraform/package.json @@ -1,8 +1,7 @@ { "name": "@cspell/dict-terraform", "version": "1.0.0", - "description": "Terraform dictionary for cspell. -- Private until verified", - "private": true, + "description": "Terraform dictionary for cspell.", "publishConfig": { "access": "public" }, @@ -13,7 +12,9 @@ }, "scripts": { "build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 cspell-tools-cli build", - "test": "head -n 1000 \"src/terraform.txt\" | cspell -v -c ./cspell-ext.json \"--locale=*\" \"--languageId=terraform\" stdin", + "test": "pnpm run test:words && pnpm run test:samples", + "test:samples": "cspell samples", + "test:words": "head -n 1000 \"src/terraform.txt\" | cspell -c ./cspell-ext.json \"--locale=*\" \"--languageId=terraform\" stdin", "prepublishOnly": "echo OK", "prepare:dictionary": "pnpm run build" }, diff --git a/dictionaries/terraform/samples/cspell.json b/dictionaries/terraform/samples/cspell.json new file mode 100644 index 00000000000..79329ea2535 --- /dev/null +++ b/dictionaries/terraform/samples/cspell.json @@ -0,0 +1,3 @@ +{ + "import": "../cspell-ext.json" +} diff --git a/dictionaries/terraform/samples/prod.tfvars b/dictionaries/terraform/samples/prod.tfvars new file mode 100644 index 00000000000..2d019c8c6cf --- /dev/null +++ b/dictionaries/terraform/samples/prod.tfvars @@ -0,0 +1 @@ +instance_type = "t2.micro" diff --git a/dictionaries/terraform/terraform.txt b/dictionaries/terraform/terraform.txt deleted file mode 100644 index 5c759f79de7..00000000000 --- a/dictionaries/terraform/terraform.txt +++ /dev/null @@ -1,52 +0,0 @@ - -# cspell-tools: keep-case no-split - -abs -chomp -cidrhost -cidrnetmask -cidrsubnet -coalesce -compact -concat -dirname -distinct -element -file -flatten -format -formatlist -indent -index -join -keys -length -list -log -lookup -lower -map -matchkeys -max -merge -min -parseint -pathexpand -pow -replace -rsadecrypt -sha -signum -slice -sort -split -substr -timestamp -title -transpose -trimspace -upper -urlencode -uuid -values -zipmap diff --git a/generator-cspell-dicts/generators/app/templates/cspell-tools.config.yaml b/generator-cspell-dicts/generators/app/templates/cspell-tools.config.yaml index d491a8bb224..bc275c4cfb1 100644 --- a/generator-cspell-dicts/generators/app/templates/cspell-tools.config.yaml +++ b/generator-cspell-dicts/generators/app/templates/cspell-tools.config.yaml @@ -7,6 +7,6 @@ targets: maxDepth: 1 # This is set to 1 to prevent initial builds from taking too long. format: '<%= format %>' targetDirectory: './dict' - generateNonStrict: '<%= generateNonStrict %>' + generateNonStrict: <%= generateNonStrict %> compress: false checksumFile: true