Created
April 14, 2020 05:44
-
-
Save tormodfj/7145368bcb11436ed5dd34b3a806215a to your computer and use it in GitHub Desktop.
Linting XAML using XamlStyler (https://gitter.im/Xavalon/XamlStyler?at=5e558b3d1be0ff01d5ab63b8)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will allow the job to only execute for Pull Request builds | |
condition: eq(variables['Build.Reason'], 'PullRequest') | |
steps: | |
- task: UseDotNet@2 | |
displayName: 'Use .Net Core runtime 3.1.x' | |
inputs: | |
packageType: runtime | |
version: 3.1.x | |
- powershell: | | |
dotnet tool install XamlStyler.Console --tool-path "$(Agent.TempDirectory)" | |
&"$(Agent.TempDirectory)\xstyler" -r -d "$(Build.SourcesDirectory)" | |
if (git status --porcelain) | |
{ | |
echo "##vso[task.logissue type=error] *** XAML differences were detected. Please ensure to execute XAML Styler on your XAML files ***" | |
exit 1 | |
} | |
displayName: 'Execute XAML Styler' | |
# You can decide if builds should fail or continue without XAML Styler formatting | |
continueOnError: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment