@@ -23,17 +23,6 @@ and then uses the mutated config file to call cspell. In the case of success
23
23
the temporary file is deleted. In the case of failure the temporary file, whose
24
24
location was logged to the console, remains on disk.
25
25
26
- . PARAMETER TargetBranch
27
- Git ref to compare changes. This is usually the "base" (GitHub) or "target"
28
- (DevOps) branch for which a pull request would be opened.
29
-
30
- . PARAMETER SourceBranch
31
- Git ref to use instead of changes in current repo state. Use `HEAD` here to
32
- check spelling of files that have been committed and exclude any new files or
33
- modified files that are not committed. This is most useful in CI scenarios where
34
- builds may have modified the state of the repo. Leaving this parameter blank
35
- includes files for whom changes have not been committed.
36
-
37
26
. PARAMETER SpellCheckRoot
38
27
Root folder from which to generate relative paths for spell checking. Mostly
39
28
used in testing.
@@ -49,7 +38,7 @@ Exit with error code 1 if spelling errors are detected.
49
38
Run test functions against the script logic
50
39
51
40
. EXAMPLE
52
- ./eng/common/scripts/check-spelling-in-changed-files.ps1 -TargetBranch 'target_branch_name'
41
+ ./eng/common/scripts/check-spelling-in-changed-files.ps1
53
42
54
43
This will run spell check with changes in the current branch with respect to
55
44
`target_branch_name`
@@ -58,12 +47,6 @@ This will run spell check with changes in the current branch with respect to
58
47
59
48
[CmdletBinding ()]
60
49
Param (
61
- [Parameter ()]
62
- [string ] $TargetBranch ,
63
-
64
- [Parameter ()]
65
- [string ] $SourceBranch ,
66
-
67
50
[Parameter ()]
68
51
[string ] $CspellConfigPath = (Resolve-Path " $PSScriptRoot /../../../.vscode/cspell.json" ),
69
52
@@ -101,7 +84,6 @@ function Test-Exit0WhenAllFilesExcluded() {
101
84
102
85
# Act
103
86
& " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
104
- - TargetBranch HEAD~1 `
105
87
- CspellConfigPath " ./.vscode/cspell.json" `
106
88
- SpellCheckRoot " ./" `
107
89
- ExitWithError
@@ -120,7 +102,6 @@ function Test-Exit1WhenIncludedFileHasSpellingError() {
120
102
121
103
# Act
122
104
& " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
123
- - TargetBranch HEAD~1 `
124
105
- CspellConfigPath " ./.vscode/cspell.json" `
125
106
- SpellCheckRoot " ./" `
126
107
- ExitWithError
@@ -139,7 +120,6 @@ function Test-Exit0WhenIncludedFileHasNoSpellingError() {
139
120
140
121
# Act
141
122
& " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
142
- - TargetBranch HEAD~1 `
143
123
- CspellConfigPath " ./.vscode/cspell.json" `
144
124
- SpellCheckRoot " ./" `
145
125
- ExitWithError
@@ -162,7 +142,6 @@ function Test-Exit1WhenChangedFileAlreadyHasSpellingError() {
162
142
163
143
# Act
164
144
& " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
165
- - TargetBranch HEAD~1 `
166
145
- CspellConfigPath " ./.vscode/cspell.json" `
167
146
- SpellCheckRoot " ./" `
168
147
- ExitWithError
@@ -185,7 +164,6 @@ function Test-Exit0WhenUnalteredFileHasSpellingError() {
185
164
186
165
# Act
187
166
& " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
188
- - TargetBranch HEAD~1 `
189
167
- CspellConfigPath " ./.vscode/cspell.json" `
190
168
- SpellCheckRoot " ./" `
191
169
- ExitWithError
@@ -204,7 +182,6 @@ function Test-Exit0WhenSpellingErrorsAndNoExitWithError() {
204
182
205
183
# Act
206
184
& " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
207
- - TargetBranch HEAD~1 `
208
185
- CspellConfigPath " ./.vscode/cspell.json" `
209
186
- SpellCheckRoot " ./"
210
187
@@ -287,7 +264,7 @@ if (!(Test-Path $CspellConfigPath)) {
287
264
}
288
265
289
266
# Lists names of files that were in some way changed between the
290
- # current $SourceBranch and $TargetBranch . Excludes files that were deleted to
267
+ # current branch and default target branch . Excludes files that were deleted to
291
268
# prevent errors in Resolve-Path
292
269
$changedFilesList = Get-ChangedFiles
293
270
0 commit comments