Comments (3)
Apparently the difference in behavior is caused by the shell used. bash
is used on GitHub Action
My project is named
Quiz
bash-5.2$ dotnet tool run xstyler --recursive --file Quiz/**/*.xaml
Processing: Quiz/**/*.xaml
Unhandled exception. System.IO.DirectoryNotFoundException: Could not find a part of the path '/Users/bartek/dev/bartekpacia/Quiz/Quiz/**/*.xaml'.
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
at System.IO.StreamReader..ctor(String path)
at Xavalon.XamlStyler.Console.XamlStylerConsole.TryProcessFile(String file) in /home/vsts/work/1/s/src/XamlStyler.Console/XamlStylerConsole.cs:line 239
at Xavalon.XamlStyler.Console.XamlStylerConsole.Process(ProcessType processType) in /home/vsts/work/1/s/src/XamlStyler.Console/XamlStylerConsole.cs:line 194
at Xavalon.XamlStyler.Console.Program.<>c.<Main>b__0_2(CommandLineOptions options) in /home/vsts/work/1/s/src/XamlStyler.Console/Program.cs:line 37
at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
at Xavalon.XamlStyler.Console.Program.Main(String[] args) in /home/vsts/work/1/s/src/XamlStyler.Console/Program.cs:line 17
bash-5.2$
Yet it works when I don't specify Quiz
explicitly:
bash-5.2$ dotnet tool run xstyler --recursive --file **/*.xaml
Processing: Quiz/App.xaml
Processing: Quiz/AppShell.xaml
Processing: Quiz/CreatePage.xaml
Processing: Quiz/MainPage.xaml
Processing: Quiz/PlayPage.xaml
Processed 5 of 5 files.
But it only processed 5 files (not what I want), whereas zsh
processed 8 (which is what I want):
zsh-5.9$ dotnet tool run xstyler --recursive --file **/*.xaml
Processing: Quiz/App.xaml
Processing: Quiz/AppShell.xaml
Processing: Quiz/CreatePage.xaml
Processing: Quiz/MainPage.xaml
Processing: Quiz/Platforms/Windows/App.xaml
Processing: Quiz/PlayPage.xaml
Processing: Quiz/Resources/Styles/Colors.xaml
Processing: Quiz/Resources/Styles/Styles.xaml
Processed 8 of 8 files.
Edit
Looks like bash
doesn't perform recursive wildcard expansion by default (SO link).
bash-5.2$ shopt -s globstar
bash-5.2$ dotnet tool run xstyler --recursive --file Quiz/**/*.xaml
Processing: Quiz/App.xaml
Processing: Quiz/AppShell.xaml
Processing: Quiz/CreatePage.xaml
Processing: Quiz/MainPage.xaml
Processing: Quiz/Platforms/Windows/App.xaml
Processing: Quiz/PlayPage.xaml
Processing: Quiz/Resources/Styles/Colors.xaml
Processing: Quiz/Resources/Styles/Styles.xaml
Processed 8 of 8 files.
Works fine after enabling it :) Bear in mind that the globstar
shell option is supported since Bash v4. The default Bash on macOS is v3.2, and it doesn't have globstar
. To install a non-ancient Bash, you can do brew install bash
.
from xamlstyler.
So, for the future wanderers, if you want to use XamlStyler.Console
in your GitHub Actions, you can do the following:
- name: Install non-ancient Bash
run: brew install bash
- name: Verify XAML code formatting
shell: bash
run: |
shopt -s globstar
dotnet tool run xstyler --recursive --file Quiz/**/*.xaml --passive
There's probably a way to do a recursive glob in PowerShell v7 but I didn't bother finding it.
from xamlstyler.
I'll reopen in case someone finds for PowerShell v7 :)
from xamlstyler.
Related Issues (20)
- When adding a Propertygroup to a project XAML, an error in StylerPackage appears HOT 3
- DataGrid Header HOT 3
- No such interface supported HOT 1
- New releases blocked on release build extension deployment bug and VS debugging HOT 7
- Final feature update and deprecate support for Visual Studio 2017
- Update Newtonsoft.Json package to version 12.0.2 HOT 3
- Files with UTF-16 encoding fail when running xstyler on Ubuntu
- Error: the nuget package not found HOT 2
- Output details about the failures when running in passive mode
- IndentWithTabs ignored if VS is configured to use tabs
- Add MAUI attribute ordering rule groups
- I hope to add features that some control not use XamlStyler Formmrat HOT 3
- Issue when trying to use external config file HOT 3
- E_NOINTERFACE Dialog from XAML Styler when saving csproj file
- Rider EAP build HOT 3
- VS Code version HOT 1
- You must install or update .NET to run this application.
- Request to Add Option for Displaying Similar Properties on the Same Line in XamlStyler HOT 3
- ">" problem in Rider HOT 3
- x:Bind Functions - String parameter gets formatted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xamlstyler.