Skip to content

Commit

Permalink
feat: Part 1 - glob patterns are relative to the config file. (#921)
Browse files Browse the repository at this point in the history
* dev: work towards specifying glob roots.
* dev: minor refactor
* Add example config
* dev: Update packages
* dev: work on normalizing patterns to a common root.
  • Loading branch information
Jason3S committed Feb 10, 2021
1 parent 1ae4812 commit a250448
Show file tree
Hide file tree
Showing 36 changed files with 760 additions and 449 deletions.
46 changes: 24 additions & 22 deletions cspell.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
"type": "string"
},
"Glob": {
"description": "These are glob expressions",
"type": "string"
"$ref": "#/definitions/SimpleGlob",
"description": "These are glob expressions"
},
"LanguageId": {
"description": "This can be '*', 'typescript', 'cpp', 'json', etc.",
Expand Down Expand Up @@ -136,11 +136,11 @@
"type": "string"
},
"ignoreRegExpList": {
"$ref": "#/definitions/RegExpList",
"$ref": "#/definitions/RegExpPatternList",
"description": "List of RegExp patterns or Pattern names to exclude from spell checking.\n\nExample: [\"href\"] - to exclude html href"
},
"includeRegExpList": {
"$ref": "#/definitions/RegExpList",
"$ref": "#/definitions/RegExpPatternList",
"description": "List of RegExp patterns or defined Pattern names to define the text to be included for spell checking. If includeRegExpList is defined, ONLY, text matching the included patterns will be checked."
},
"languageId": {
Expand Down Expand Up @@ -267,15 +267,8 @@
"description": "Optional identifier",
"type": "string"
},
"ignorePaths": {
"description": "Glob file patterns to be ignored",
"items": {
"$ref": "#/definitions/Glob"
},
"type": "array"
},
"ignoreRegExpList": {
"$ref": "#/definitions/RegExpList",
"$ref": "#/definitions/RegExpPatternList",
"description": "List of RegExp patterns or Pattern names to exclude from spell checking.\n\nExample: [\"href\"] - to exclude html href"
},
"ignoreWords": {
Expand All @@ -286,7 +279,7 @@
"type": "array"
},
"includeRegExpList": {
"$ref": "#/definitions/RegExpList",
"$ref": "#/definitions/RegExpPatternList",
"description": "List of RegExp patterns or defined Pattern names to define the text to be included for spell checking. If includeRegExpList is defined, ONLY, text matching the included patterns will be checked."
},
"language": {
Expand Down Expand Up @@ -393,12 +386,6 @@
],
"type": "string"
},
"RegExpList": {
"items": {
"$ref": "#/definitions/PatternRef"
},
"type": "array"
},
"RegExpPatternDefinition": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -431,6 +418,13 @@
],
"type": "object"
},
"RegExpPatternList": {
"description": "A list of pattern names or regular expressions",
"items": {
"$ref": "#/definitions/PatternRef"
},
"type": "array"
},
"ReplaceEntry": {
"items": [
{
Expand All @@ -449,6 +443,10 @@
"$ref": "#/definitions/ReplaceEntry"
},
"type": "array"
},
"SimpleGlob": {
"description": "Simple Glob string, the root will be globRoot",
"type": "string"
}
},
"properties": {
Expand Down Expand Up @@ -502,19 +500,23 @@
},
"type": "array"
},
"globRoot": {
"$ref": "#/definitions/FsPath",
"description": "The root to use for glop patterns found in this configuration. Default: location of the configuration file.\n\nUse `globRoot` to define a different location. `globRoot` can be relative to the location of this configuration file. Defining globRoot, does not impact imported configurations."
},
"id": {
"description": "Optional identifier",
"type": "string"
},
"ignorePaths": {
"description": "Glob file patterns to be ignored",
"description": "Glob patterns of files to be ignored Glob patterns are relative to the `globRoot` of the configuration file that defines them.",
"items": {
"$ref": "#/definitions/Glob"
},
"type": "array"
},
"ignoreRegExpList": {
"$ref": "#/definitions/RegExpList",
"$ref": "#/definitions/RegExpPatternList",
"description": "List of RegExp patterns or Pattern names to exclude from spell checking.\n\nExample: [\"href\"] - to exclude html href"
},
"ignoreWords": {
Expand All @@ -539,7 +541,7 @@
"description": "Other settings files to be included"
},
"includeRegExpList": {
"$ref": "#/definitions/RegExpList",
"$ref": "#/definitions/RegExpPatternList",
"description": "List of RegExp patterns or defined Pattern names to define the text to be included for spell checking. If includeRegExpList is defined, ONLY, text matching the included patterns will be checked."
},
"language": {
Expand Down
48 changes: 24 additions & 24 deletions integration-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"mkdirp": "^1.0.4",
"rimraf": "^3.0.2",
"shelljs": "^0.8.4",
"simple-git": "^2.31.0"
"simple-git": "^2.34.2"
},
"devDependencies": {
"@types/mkdirp": "^1.0.1",
"@types/node": "^14.14.22",
"@types/node": "^14.14.25",
"@types/rimraf": "^3.0.0",
"@types/shelljs": "^0.8.8",
"jest": "^26.6.3"
Expand Down
36 changes: 18 additions & 18 deletions packages/cspell-glob/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cspell-glob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"devDependencies": {
"@types/micromatch": "^4.0.1",
"@types/node": "^14.14.22",
"@types/node": "^14.14.25",
"jest": "^26.6.3",
"rimraf": "^3.0.2"
}
Expand Down
Loading

0 comments on commit a250448

Please sign in to comment.