@@ -23,17 +23,6 @@ and then uses the mutated config file to call cspell. In the case of success
2323the temporary file is deleted. In the case of failure the temporary file, whose
2424location was logged to the console, remains on disk.
2525
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-
3726. PARAMETER SpellCheckRoot
3827Root folder from which to generate relative paths for spell checking. Mostly
3928used in testing.
@@ -49,7 +38,7 @@ Exit with error code 1 if spelling errors are detected.
4938Run test functions against the script logic
5039
5140. 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
5342
5443This will run spell check with changes in the current branch with respect to
5544`target_branch_name`
@@ -58,12 +47,6 @@ This will run spell check with changes in the current branch with respect to
5847
5948[CmdletBinding ()]
6049Param (
61- [Parameter ()]
62- [string ] $TargetBranch ,
63-
64- [Parameter ()]
65- [string ] $SourceBranch ,
66-
6750 [Parameter ()]
6851 [string ] $CspellConfigPath = (Resolve-Path " $PSScriptRoot /../../../.vscode/cspell.json" ),
6952
@@ -101,7 +84,6 @@ function Test-Exit0WhenAllFilesExcluded() {
10184
10285 # Act
10386 & " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
104- - TargetBranch HEAD~1 `
10587 - CspellConfigPath " ./.vscode/cspell.json" `
10688 - SpellCheckRoot " ./" `
10789 - ExitWithError
@@ -120,7 +102,6 @@ function Test-Exit1WhenIncludedFileHasSpellingError() {
120102
121103 # Act
122104 & " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
123- - TargetBranch HEAD~1 `
124105 - CspellConfigPath " ./.vscode/cspell.json" `
125106 - SpellCheckRoot " ./" `
126107 - ExitWithError
@@ -139,7 +120,6 @@ function Test-Exit0WhenIncludedFileHasNoSpellingError() {
139120
140121 # Act
141122 & " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
142- - TargetBranch HEAD~1 `
143123 - CspellConfigPath " ./.vscode/cspell.json" `
144124 - SpellCheckRoot " ./" `
145125 - ExitWithError
@@ -162,7 +142,6 @@ function Test-Exit1WhenChangedFileAlreadyHasSpellingError() {
162142
163143 # Act
164144 & " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
165- - TargetBranch HEAD~1 `
166145 - CspellConfigPath " ./.vscode/cspell.json" `
167146 - SpellCheckRoot " ./" `
168147 - ExitWithError
@@ -185,7 +164,6 @@ function Test-Exit0WhenUnalteredFileHasSpellingError() {
185164
186165 # Act
187166 & " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
188- - TargetBranch HEAD~1 `
189167 - CspellConfigPath " ./.vscode/cspell.json" `
190168 - SpellCheckRoot " ./" `
191169 - ExitWithError
@@ -204,7 +182,6 @@ function Test-Exit0WhenSpellingErrorsAndNoExitWithError() {
204182
205183 # Act
206184 & " $PSScriptRoot /check-spelling-in-changed-files.ps1" `
207- - TargetBranch HEAD~1 `
208185 - CspellConfigPath " ./.vscode/cspell.json" `
209186 - SpellCheckRoot " ./"
210187
@@ -287,7 +264,7 @@ if (!(Test-Path $CspellConfigPath)) {
287264}
288265
289266# 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
291268# prevent errors in Resolve-Path
292269$changedFilesList = Get-ChangedFiles
293270
0 commit comments