Skip to content

Commit

Permalink
feat: Remove incorrect Ignore Hex Digits Regexp (#1277)
Browse files Browse the repository at this point in the history
Minor **BREAKING** change.

`cspell` used to ignore all words that had just hex characters `[a-f]`. This lead to issues like #1276. `cspell` will no longer ignore words with only hex characters. To avoid load of false positives (cases where a hex number was intended)
some new patterns were added:
- `CStyleHexValue`: C Style `0x[a-f0-9]+` 
- `CSSHexValue`: CSS Style `#[a-f0-9]+`
- `CommitHash`: GitHub Style commit hashes. - this ignores hex only words that are 7 characters or longer
   might still lead to false negatives.
- `UnicodeRef`: ignores `U+0000` style codes and ranges `U+0000-ffff`
- `UUID`: ignores formatted UUIDs

**Related Changes**
* fix: Remove incorrect Ignore Hex Digits Regexp
  Fix: #1276 
* fix: Ignore commit hashes and C Style Hex numbers
* ci: speed up integration test for AdaDoom
  Do not check machine generated files.
* fix: Ignore CSS Hex Values and UUIDs
* fix: Add more common patterns to ignore
  Try to detect common hex and Unicode patterns to ignore.
* test: simplify testing `bin.js` commands
  • Loading branch information
Jason3S authored May 28, 2021
1 parent 7c42f35 commit 2621eb0
Show file tree
Hide file tree
Showing 30 changed files with 313 additions and 1,729 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ jobs:
- run: npm test

- name: verify trace command
run: node ./bin.js trace test
run: npm run test-bin-trace

- name: verify the spell checker runs
run: node ./bin.js -c cspellrc.json
run: npm run test-bin-spell

- name: verify the check command
run: npm run test-bin-check

# Ensure the repository is clean after build & test
- run: git --no-pager diff --compact-summary --exit-code
Expand Down Expand Up @@ -67,10 +70,13 @@ jobs:
- run: npm test

- name: verify trace command
run: node ./bin.js trace test
run: npm run test-bin-trace

- name: verify the spell checker runs
run: node ./bin.js -c cspellrc.json
run: npm run test-bin-spell

- name: verify the check command
run: npm run test-bin-check

# Ensure the repository is clean after build & test
- run: git --no-pager diff --compact-summary --exit-code
10 changes: 7 additions & 3 deletions cspell.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,11 @@
"enum": [
"Base64",
"CStyleComment",
"CStyleHexValue",
"CSSHexValue",
"CommitHash",
"Email",
"EscapeCharacters",
"HexDigits",
"HexValues",
"href",
"PhpHereDoc",
Expand All @@ -505,7 +507,9 @@
"SpellCheckerDisableNext",
"SpellCheckerIgnoreInDocSetting",
"string",
"UnicodeRef",
"Urls",
"UUID",
"Everything"
],
"type": "string"
Expand Down Expand Up @@ -748,15 +752,15 @@
"type": "number"
},
"userWords": {
"description": "Words to add to dictionary -- should only be in the user config file.",
"description": "Words to add to global dictionary -- should only be in the user config file.",
"items": {
"type": "string"
},
"type": "array"
},
"version": {
"default": "0.2",
"description": "Configuration format version of the setting file.",
"description": "Configuration format version of the settings file.",
"enum": [
"0.2",
"0.1"
Expand Down
18 changes: 9 additions & 9 deletions integration-tests/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"path": "php/php-src",
"url": "https://github.com/php/php-src.git",
"commit": "010d6a491cf1ffcaefe42904d78c53918df5970a",
"commit": "6e477d205ee2108f7f53fee84a996c4771e041ee",
"args": [
"--config=${repoConfig}/cspell.json",
"**/*.{md,c,h,php}"
Expand Down Expand Up @@ -79,7 +79,7 @@
{
"path": "aws-amplify/docs",
"url": "https://github.com/aws-amplify/docs.git",
"commit": "c4f631c8f7aafc7e5407d5b81a46dac88382f913",
"commit": "362fbabe952b9ff9ee5f78ff7562c6c00127fae7",
"args": [
"docs/**/*.md"
]
Expand All @@ -97,7 +97,7 @@
{
"path": "prettier/prettier",
"url": "https://github.com/prettier/prettier.git",
"commit": "81a1c463116f9dc8ec5e8059d70a9254675847e6",
"commit": "9d53f64d851839f542ee2a876c6197b336a239b0",
"args": [
".github/**/*",
"**/*.*"
Expand All @@ -106,7 +106,7 @@
{
"path": "webpack/webpack",
"url": "https://github.com/webpack/webpack.git",
"commit": "daa0f1ed1cebc28c8cc9034f95f3b56e9253ec5e",
"commit": "487665cb69f7b1f1aac44097124ef8f33cfe247b",
"args": [
"{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}",
"*.md"
Expand Down Expand Up @@ -141,15 +141,15 @@
{
"path": "graphql/graphql-js",
"url": "https://github.com/graphql/graphql-js.git",
"commit": "c589c3d285cb1ec44b09bf0b50ec041ec083760c",
"commit": "bf26a52257cc47513d8a0bd8219c57c8fd279d4a",
"args": [
"**/*.*"
]
},
{
"path": "microsoft/TypeScript-Website",
"url": "https://github.com/microsoft/TypeScript-Website.git",
"commit": "037045497bffa9be7cb7cb9810922041adc72a28",
"commit": "b85eca4411be549c043b3af8fdc0aa6f5ee459fc",
"args": [
"--config=${repoConfig}/cspell.json",
"**/*.*"
Expand All @@ -162,7 +162,7 @@
"--config=cSpell.json",
"**/*.{md,ts,js}"
],
"commit": "9875f8eebd8c1392a83c052bc50a79c8251b1174"
"commit": "98786a35a3d940e5e5082e66de6835d2e8f650f3"
},
{
"path": "pycontribs/jira",
Expand Down Expand Up @@ -191,7 +191,7 @@
{
"path": "django/django",
"url": "https://github.com/django/django.git",
"commit": "02c59b7a4355fda8c99224b5de9c0a3929bffe22",
"commit": "22da686ca93e99f8091334f66d7199bc29b85c83",
"args": [
"**/*.{md,py}"
]
Expand Down Expand Up @@ -257,7 +257,7 @@
"-e",
"{*.BUILD,BUILD,CHANGELOG.md,*.sh,*.cfg,*.ps1,Dockerfile.*,*.Dockerfile,*.{yaml,xml,json,cmake}}"
],
"commit": "2424ec1c03d1dc03bc689846a47ca655fc7b3e10"
"commit": "63fa939ec1b1408385d48e5dea8d8de5f0fbc480"
}
]
}
2 changes: 1 addition & 1 deletion integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"scripts": {
"build": "tsc -p .",
"clean": "rimraf dist temp repositories/temp",
"clean": "rimraf repositories/temp dist temp",
"postinstall": "npm run build",
"integration-tests": "node tester.js check -f",
"test-jest": "jest",
Expand Down
2 changes: 2 additions & 0 deletions integration-tests/repositories/cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ words:

ignorePaths:
- "*.ktx"
- "*.idmap" # DOOM, cspell:ignore idmap
- "*.ogex" # DOOM, cspell:ignore ogex

import:
- "./cspell-latex.json"
Expand Down
Loading

0 comments on commit 2621eb0

Please sign in to comment.