Skip to content

Commit

Permalink
adding step to test for crlf line endings (#16398)
Browse files Browse the repository at this point in the history
* adding step to test for crlf line endings

* new script

* changing from a printf statement to echos

* changed over to a powershell script

* removed $ to check on any point in a file

* added a Throw statement

* changing to a nested If statement

* changing to build.sourcesdirectory

* Update eng/pipelines/templates/steps/analyze.yml

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Update eng/pipelines/templates/steps/analyze.yml

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

* Update eng/pipelines/templates/steps/analyze.yml

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>

Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
  • Loading branch information
seankane-msft and weshaggard authored Feb 1, 2021
1 parent c94211b commit 8ba125a
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions eng/pipelines/templates/steps/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ steps:
python find_invalid_versions.py --always-succeed --service=${{parameters.ServiceDirectory}}
displayName: Find Invalid Versions
- pwsh: |
Get-ChildItem $(Build.SourcesDirectory) -Filter "*.py" |
Foreach-Object {
if ((Get-Content $_ -Raw) -match "\r\n") {
Write-Error "Found CRLF line ending in `$_`"
}
}
Get-ChildItem $(Build.SourcesDirectory) -Filter "*.md" |
Foreach-Object {
if ((Get-Content $_ -Raw) -match "\r\n") {
Write-Error "Found CRLF line ending in `$_`"
}
}
displayName: Check for CRLF Line endings
- template: /eng/common/pipelines/templates/steps/verify-path-length.yml
parameters:
SourceDirectory: $(Build.SourcesDirectory)
Expand Down Expand Up @@ -58,13 +74,13 @@ steps:
arguments: '"${{ parameters.BuildTargetingString }}" --service=${{parameters.ServiceDirectory}} --toxenv=verifywhl'

- template: run_mypy.yml
parameters:
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
BuildTargetingString: ${{ parameters.BuildTargetingString }}
TestMarkArgument: ${{ parameters.TestMarkArgument }}

- template: run_pylint.yml
parameters:
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
BuildTargetingString: ${{ parameters.BuildTargetingString }}
TestMarkArgument: ${{ parameters.TestMarkArgument }}
Expand Down Expand Up @@ -94,4 +110,4 @@ steps:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
BuildTargetingString: ${{ parameters.BuildTargetingString }}
TestMarkArgument: ${{ parameters.TestMarkArgument }}
AdditionalTestArgs: ${{parameters.AdditionalTestArgs}}
AdditionalTestArgs: ${{parameters.AdditionalTestArgs}}

0 comments on commit 8ba125a

Please sign in to comment.