Skip to content

Commit

Permalink
Fix the format issue in the CI (#1222)
Browse files Browse the repository at this point in the history
* call fantomas directly instead of using msbuild target

* just check the format

* no need to exclude obj directories if we pass in just a directory
  • Loading branch information
dawedawe authored Jan 15, 2024
1 parent e224f1a commit c062df2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
run: dotnet tool restore

- name: Check format
run: dotnet build -t:CheckFormat
run: dotnet fantomas --check src
env:
DOTNET_ROLL_FORWARD: LatestMajor
DOTNET_ROLL_FORWARD_TO_PRERELEASE: 1
Expand Down
8 changes: 2 additions & 6 deletions Directory.Solution.targets
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<Project>
<ItemGroup>
<FormatInputs Include="src/**/*.fs;src/**/*.fsi" Exclude="src/**/obj/**/*.fs" />
</ItemGroup>

<Target Name="Format">
<Exec Command="dotnet fantomas @(FormatInputs, ' ') " />
<Exec Command="dotnet fantomas src" />
</Target>

<Target Name="CheckFormat">
<Exec Command="dotnet fantomas --check @(FormatInputs, ' ') " />
<Exec Command="dotnet fantomas --check src" />
</Target>

<ItemGroup>
Expand Down

0 comments on commit c062df2

Please sign in to comment.