Skip to content

Commit f487d45

Browse files
authored
Standardize project settings to opt-out from 'unused bindings' detection across the repo (#18431)
1 parent dbf4c92 commit f487d45

File tree

19 files changed

+31
-27
lines changed

19 files changed

+31
-27
lines changed

FSharp.Profiles.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
<DefineConstants>BUILDING_WITH_LKG;$(DefineConstants)</DefineConstants>
77
</PropertyGroup>
88

9+
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.fsproj' and $(TolerateUnusedBindings) != 'true'">
10+
<WarningsAsErrors>1182;$(WarningsAsErrors)</WarningsAsErrors>
11+
<WarnOn>1182;$(WarnOn)</WarnOn>
12+
</PropertyGroup>
13+
14+
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.fsproj' and $(TolerateUnusedBindings) == 'true'">
15+
<WarningsNotAsErrors>1182;$(WarningsNotAsErrors)</WarningsNotAsErrors>
16+
<NoWarn>1182;$(NoWarn)</NoWarn>
17+
</PropertyGroup>
18+
919
<PropertyGroup Condition="'$(Configuration)' != 'Proto' and '$(BUILDING_USING_DOTNET)' != 'true' and '$(MSBuildProjectExtension)' == '.fsproj'"> <!-- VB.NET does not understand "preview". It only knows "old","older" and "boomer" :-)) (jk)-->
1020
<LangVersion>preview</LangVersion>
1121
</PropertyGroup>

FSharpBuild.Directory.Build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
<SymStoreDirectory>$(ArtifactsDir)\SymStore</SymStoreDirectory>
2828
<ProtoOutputPath>$(ArtifactsDir)\Bootstrap</ProtoOutputPath>
2929
<ValueTupleImplicitPackageVersion>4.4.0</ValueTupleImplicitPackageVersion>
30-
<WarnOn>$(WarnOn);1182</WarnOn>
31-
<WarningsAsErrors>1182;0025;$(WarningsAsErrors)</WarningsAsErrors>
30+
<WarningsAsErrors>0025;$(WarningsAsErrors)</WarningsAsErrors>
3231
<OtherFlags>$(OtherFlags) --nowarn:3384</OtherFlags>
3332
<OtherFlags>$(OtherFlags) --times --nowarn:75</OtherFlags>
3433
<OtherFlags Condition="$(AdditionalFscCmdFlags) != ''">$(OtherFlags) $(AdditionalFscCmdFlags)</OtherFlags>

buildtools/fslex/fslex.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
66
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
77
<RollForward Condition="'$(BUILDING_USING_DOTNET)' == 'true'">LatestMajor</RollForward>
8-
<NoWarn>$(NoWarn);64;1204;1182</NoWarn> <!--Temporary fix for sourcebuild -->
9-
<OtherFlags>$(OtherFlags) --warnaserror-:1182</OtherFlags>
8+
<NoWarn>$(NoWarn);64;1204</NoWarn> <!--Temporary fix for sourcebuild -->
9+
<TolerateUnusedBindings>true</TolerateUnusedBindings>
1010
</PropertyGroup>
1111

1212
<PropertyGroup>

buildtools/fsyacc/fsyacc.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
66
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
77
<RollForward Condition="'$(BUILDING_USING_DOTNET)' == 'true'">LatestMajor</RollForward>
8-
<NoWarn>$(NoWarn);64;1204;1182</NoWarn> <!--Temporary fix for sourcebuild -->
9-
<OtherFlags>$(OtherFlags) --warnaserror-:1182</OtherFlags>
8+
<NoWarn>$(NoWarn);64;1204</NoWarn> <!--Temporary fix for sourcebuild -->
9+
<TolerateUnusedBindings>true</TolerateUnusedBindings>
1010
</PropertyGroup>
1111

1212
<PropertyGroup>

src/FSharp.Core/FSharp.Core.fsproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
<DefineConstants>$(DefineConstants);FSHARP_CORE</DefineConstants>
1414
<!-- 3218: ArgumentsInSigAndImplMismatch -->
1515
<OtherFlags>$(OtherFlags) --warnon:3218</OtherFlags>
16-
<!-- 1182: Unused variables -->
17-
<OtherFlags>$(OtherFlags) --warnon:1182</OtherFlags>
1816
<!-- 3390: xmlDocBadlyFormed -->
1917
<OtherFlags>$(OtherFlags) --warnon:3390</OtherFlags>
2018
<!-- 3520: invalidXmlDocPosition -->

src/fsi/fsi.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<Configurations>Debug;Release;Proto</Configurations>
88
<NoWarn>$(NoWarn);44</NoWarn> <!-- Obsolete -->
99
<AllowCrossTargeting>true</AllowCrossTargeting>
10-
<OtherFlags>$(OtherFlags) --warnon:1182</OtherFlags>
1110
<Win32Resource>$(MSBuildThisFileDirectory)fsi.res</Win32Resource>
1211
</PropertyGroup>
1312

tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<ExcludeFromSourceOnlyBuild>true</ExcludeFromSourceOnlyBuild>
1414
<Optimize>false</Optimize>
1515
<Tailcalls>false</Tailcalls>
16-
<OtherFlags>$(OtherFlags) --warnon:1182</OtherFlags>
1716
<NoWarn>$(NoWarn);FS0988</NoWarn> <!-- "program does nothing" warning -->
1817
<DefineConstants Condition="'$(Configuration)'=='release'">$(DefineConstants);RELEASE</DefineConstants>
1918
<DefineConstants Condition="'$(Configuration)'=='debug'">$(DefineConstants);DEBUG</DefineConstants>

tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
<TargetFrameworks>net472;$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
66
<TargetFrameworks Condition="'$(OS)' == 'Unix' or '$(BUILDING_USING_DOTNET)' == 'true'">$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8-
<NoWarn>$(NoWarn);1182</NoWarn> <!-- suppress warning for unused values in FSharp.Compiler.Service.Tests tests, very often checker results are needed, but not used -->
9-
<OtherFlags>$(OtherFlags) --warnaserror-:1182</OtherFlags>
8+
<TolerateUnusedBindings>true</TolerateUnusedBindings>
109
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
1110
<UnitTestType>xunit</UnitTestType>
1211
</PropertyGroup>

tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
<PackageVersion>$(FSCoreUnitTestsPackageVersion)</PackageVersion>
1313
<PreRelease>true</PreRelease>
1414
<LangVersion>preview</LangVersion>
15-
<NoWarn>$(NoWarn);1182</NoWarn> <!-- suppress warning for unused values in FSharp.Core tests, there are way too many of edge case scenarios tested -->
16-
<OtherFlags>$(OtherFlags) --warnaserror-:1182</OtherFlags>
15+
<TolerateUnusedBindings>true</TolerateUnusedBindings>
1716
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
1817
<UnitTestType>xunit</UnitTestType>
1918
<IsTestProject>true</IsTestProject>

tests/FSharp.Test.Utilities/FSharp.Test.Utilities.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Tailcalls>false</Tailcalls>
1313
<UnitTestType>xunit</UnitTestType>
1414
<IsTestProject>true</IsTestProject>
15-
<OtherFlags>$(OtherFlags) --warnon:1182 --realsig-</OtherFlags>
15+
<OtherFlags>$(OtherFlags) --realsig-</OtherFlags>
1616
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
1717
<!--Extra xUnit customizations, not required for the test suite to work, but can speed up local test runs and help with debugging.-->
1818
<DefineConstants>XUNIT_EXTRAS</DefineConstants>

0 commit comments

Comments
 (0)