Skip to content

Commit 98905d8

Browse files
committed
updating files with random line endings and general file cleanup
1 parent cb5958f commit 98905d8

26 files changed

Lines changed: 2886 additions & 2864 deletions

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
},
2626
"postCreateCommand": "pwsh -NoProfile -File ./build.ps1 -Task Init -Bootstrap"
2727
}
28-
28+

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ Documentation improvements are welcome. Please update relevant documentation whe
5858
- [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
5959
- [GitHub Flow guide](https://guides.github.com/introduction/flow/)
6060
- [GitHub's guide to contributing to open source projects](https://guides.github.com/activities/contributing-to-open-source/)
61-
61+

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
<!--- Include as many relevant details about the environment you experienced the bug in -->
2929
* Module version used:
3030
* Operating System and PowerShell version:
31-
31+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
- [ ] I have read the **CONTRIBUTING** document.
3535
- [ ] I have added tests to cover my changes.
3636
- [ ] All new and existing tests passed.
37-
37+

.github/workflows/canary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,4 @@ jobs:
226226
--title $title `
227227
--body-file $bodyPath
228228
}
229-
229+

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
env:
2727
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
2828
run: ./tools/Publish-PSGallery.ps1
29-
29+

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
- name: Test
3333
shell: powershell
3434
run: ./build.ps1 -Task Test -Bootstrap
35-
35+

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ available at [http://contributor-covenant.org/version/1/4/1][version]
7171

7272
[homepage]: http://contributor-covenant.org
7373
[version]: http://contributor-covenant.org/version/1/4/
74-
74+

Tests/Meta.tests.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ BeforeAll {
1313
$allTextFiles = Get-TextFilesList $projectRoot
1414
$unicodeFilesCount = 0
1515
$totalTabsCount = 0
16+
$trailingWhitespaceCount = 0
1617
foreach ($textFile in $allTextFiles) {
1718
if (Test-FileUnicode $textFile) {
1819
$unicodeFilesCount++
@@ -32,6 +33,15 @@ BeforeAll {
3233
)
3334
$totalTabsCount++
3435
}
36+
37+
$lineNumber = 0
38+
foreach ($line in [System.IO.File]::ReadAllLines($fileName)) {
39+
$lineNumber++
40+
if ($line -match '[\t ]+$') {
41+
Write-Warning "Trailing whitespace found in ${fileName}:$lineNumber."
42+
$trailingWhitespaceCount++
43+
}
44+
}
3545
}
3646
}
3747

@@ -47,4 +57,10 @@ Describe 'Text files formatting' {
4757
$totalTabsCount | Should -Be 0
4858
}
4959
}
60+
61+
Context 'Trailing whitespace' {
62+
It 'No text file has trailing spaces or tabs' {
63+
$trailingWhitespaceCount | Should -Be 0
64+
}
65+
}
5066
}

Tests/MetaFixers.psm1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,18 @@ function Get-TextFilesList {
4444
)
4545

4646
begin {
47-
$txtFileExtentions = @('.gitignore', '.gitattributes', '.ps1', '.psm1', '.psd1', '.json', '.xml', '.cmd', '.mof')
47+
$textFileExtensions = @(
48+
'.cmd', '.cs', '.csproj', '.json', '.md', '.mof', '.ps1', '.psd1',
49+
'.psm1', '.sql', '.xml', '.yaml', '.yml'
50+
)
51+
$textFileNames = @('.gitattributes', '.gitignore', 'LICENSE')
4852
}
4953

5054
process {
5155
Get-ChildItem -Path $Root -File -Recurse |
52-
Where-Object { $_.Extension -in $txtFileExtentions }
56+
Where-Object {
57+
$_.Extension -in $textFileExtensions -or $_.Name -in $textFileNames
58+
}
5359
}
5460
}
5561

0 commit comments

Comments
 (0)