Skip to content

Commit

Permalink
Merge pull request #2268 from microsoft/dpaul-AddDotCspell
Browse files Browse the repository at this point in the history
Add --dot to cspell check
  • Loading branch information
dpaulson45 authored Jan 16, 2025
2 parents f25acba + 99f7a1f commit 61ec703
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .build/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ $allScriptFiles = Get-ChildItem -Path $repoRoot -Directory |
ForEach-Object { $_.FullName }

<#
Build the table of depedencies, and a separate table of commit times.
Build the table of dependencies, and a separate table of commit times.
#>

$dependencyHashtable = Get-ScriptDependencyHashtable -FileNames $allScriptFiles
Expand Down
4 changes: 2 additions & 2 deletions .build/BuildFunctions/Get-DotSourcedScriptName.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function Get-DotSourcedScriptName {
process {
$m = $Line | Select-String "\. (?:\.|\`$PSScriptRoot)\\(.*).ps1"
if ($null -ne $m) {
$dotloadedScriptPath = $m.Matches[0].Groups[1].Value + ".ps1"
$dotloadedScriptPath
$dotLoadedScriptPath = $m.Matches[0].Groups[1].Value + ".ps1"
$dotLoadedScriptPath
}
}
}
4 changes: 2 additions & 2 deletions .build/BuildFunctions/Get-ScriptDependencyHashtable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function Get-ScriptDependencyHashtable {

if ($currentFile.EndsWith(".ps1")) {
Select-String "\. (?:\.|\`$PSScriptRoot)\\(.*).ps1" $currentFile | ForEach-Object {
$dotloadedScriptPath = $_.Matches[0].Groups[1].Value + ".ps1"
$dotSourcedFile = (Get-Item (Join-Path $currentFolder $dotloadedScriptPath)).FullName
$dotLoadedScriptPath = $_.Matches[0].Groups[1].Value + ".ps1"
$dotSourcedFile = (Get-Item (Join-Path $currentFolder $dotLoadedScriptPath)).FullName
$deps[$currentFile] += $dotSourcedFile
if ($null -eq $deps[$dotSourcedFile]) {
$stack.Push($dotSourcedFile)
Expand Down
2 changes: 1 addition & 1 deletion .build/CodeFormatter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ foreach ($fileInfo in $filesToCheck) {
}
break
} catch {
Write-Warning "Invoke-ScriptAnalyer failed on $($fileInfo.FullName). Error:"
Write-Warning "Invoke-ScriptAnalyzer failed on $($fileInfo.FullName). Error:"
$_.Exception | Format-List | Out-Host
Write-Warning "Retrying in 5 seconds."
Start-Sleep -Seconds 5
Expand Down
4 changes: 2 additions & 2 deletions .build/CodeFormatterChecks/CheckScriptFileHasBOM.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ function CheckScriptFileHasBOM {
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding
"If you need to use non-Ascii characters in your scripts, save them as UTF-8 with BOM.
"If you need to use non-ASCII characters in your scripts, save them as UTF-8 with BOM.
Without the BOM, Windows PowerShell misinterprets your script as being encoded in the
legacy "ANSI" codepage. Conversely, files that do have the UTF-8 BOM can be problematic
legacy "ANSI" CodePage. Conversely, files that do have the UTF-8 BOM can be problematic
on Unix-like platforms."
Since these scripts are purely for Exchange and Exchange Online, we expect they will usually
Expand Down
1 change: 1 addition & 0 deletions .build/Docs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

$repoRoot = Get-Item "$PSScriptRoot\.."
$docsDir = "$repoRoot\docs"
#cspell:words mkdocs
$markDownFiles = Get-Content "$repoRoot\mkdocs.yml" | Select-String "(\S+\.md)" | ForEach-Object {
$_.Matches.Groups[1].Value
}
Expand Down
4 changes: 2 additions & 2 deletions .build/HelpFunctions/Get-CommitFilesOnBranch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ function Get-CommitFilesOnBranch {

Write-Verbose "Checking commits only"
# Get all the commits between origin/$Branch and HEAD.
$gitlog = git log --format="%H %cd" --date=rfc origin/$Branch..HEAD
$m = $gitlog | Select-String "^(\S+) (.*)$"
$gitLog = git log --format="%H %cd" --date=rfc origin/$Branch..HEAD
$m = $gitLog | Select-String "^(\S+) (.*)$"

foreach ($commitMatch in $m) {
$commitHash = $commitMatch.Matches.Groups[1].Value
Expand Down
2 changes: 1 addition & 1 deletion .build/SpellCheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function DoSpellCheck {

$repoRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot ".."))

cspell lint --config "$PSScriptRoot\cspell.json" --no-progress (Join-Path $repoRoot "**" "*.md") (Join-Path $repoRoot "**" "*.ps1")
cspell lint --dot --config "$PSScriptRoot\cspell.json" --no-progress (Join-Path $repoRoot "**" "*.md") (Join-Path $repoRoot "**" "*.ps1")
}

DoSpellCheck
10 changes: 5 additions & 5 deletions .build/ValidateMerge.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ $allowMergeFiles = @()
$filesAlreadyChecked = New-Object 'System.Collections.Generic.HashSet[string]'

# Get all the commits between origin/$Branch and HEAD.
$gitlog = git log --format="%H %cd" --date=rfc origin/$Branch..HEAD
$m = $gitlog | Select-String "^(\S+) (.*)$"
$gitLog = git log --format="%H %cd" --date=rfc origin/$Branch..HEAD
$m = $gitLog | Select-String "^(\S+) (.*)$"

foreach ($commitMatch in $m) {
$commitHash = $commitMatch.Matches.Groups[1].Value
Expand Down Expand Up @@ -77,11 +77,11 @@ foreach ($commitMatch in $m) {
$topLevelDependents = New-Object 'System.Collections.Generic.HashSet[string]'
while ($stack.Count -gt 0) {
$currentFile = $stack.Pop()
$depdendents = $dependentsTable[$currentFile]
if ($null -eq $depdendents -or $depdendents.Count -eq 0) {
$dependents = $dependentsTable[$currentFile]
if ($null -eq $dependents -or $dependents.Count -eq 0) {
[void]$topLevelDependents.Add($currentFile)
} else {
foreach ($dependent in $depdendents) {
foreach ($dependent in $dependents) {
[void]$stack.Push($dependent)
}
}
Expand Down
4 changes: 2 additions & 2 deletions Setup/.NotPublished/ScrubSetupLog.NotPublished.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function ScrubValuesAndReplace {
$Script:logContent = $newContent
}

$scrubToDomainPossibleName = "Rey.Ben.Skywalker.Child.Solo.local"
$scrubToDomainPossibleName = "Rey.Ben.SkyWalker.Child.Solo.local"

#Scrub the data
$loggedOnUserSls = $logContent | Select-String "Logged on user: (.+)."
Expand Down Expand Up @@ -196,7 +196,7 @@ $orgContainerMatch = $orgContainerSls.Line.Substring($index, $orgContainerSls.Li
$orgContainer = $orgContainerMatch.Replace($orgContainerSls.Matches.Groups[1].Value, "SoloORG")

ScrubValuesAndReplace -Match $orgContainerMatch -Replace $orgContainer
ScrubValuesAndReplace -Match $orgContainersls.Matches.Groups[1].Value -Replace "SoloORG"
ScrubValuesAndReplace -Match $orgContainerSls.Matches.Groups[1].Value -Replace "SoloORG"

$serverFQDNSls = $logContent | Select-String "Evaluated \[Setting:ComputerNameDnsFullyQualified\].+\[Value:`"(.+)`"\] \[ParentValue:"
$i = 1
Expand Down

0 comments on commit 61ec703

Please sign in to comment.