Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
"version": 1,
"isRoot": true,
"tools": {
"dotnet-fsharplint": {
"version": "0.26.10",
"commands": [
"dotnet-fsharplint"
],
"rollForward": false
},
"fantomas": {
"version": "8.0.0",
"commands": [
Expand All @@ -24,7 +17,7 @@
"rollForward": false
},
"fsharp-analyzers": {
"version": "0.39.1",
"version": "0.39.2",
"commands": [
"fsharp-analyzers"
],
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:10.0.400
FROM mcr.microsoft.com/dotnet/sdk:11.0.100-rc.1

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ local.properties
*.pgc
*.pgd
*.rsp
!Directory.Build.rsp
*.sbr
*.tlb
*.tli
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Some common use cases include:
<!-- https://www.gresearch.co.uk/blog/article/improve-nuget-restores-with-static-graph-evaluation/ -->
<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>
<ServerGarbageCollection>true</ServerGarbageCollection>
<OtherFlags>$(OtherFlags) --test:GraphBasedChecking --test:ParallelOptimization --test:ParallelIlxGen --strict-indentation+ --realsig+</OtherFlags>
<OtherFlags>$(OtherFlags) --realsig+</OtherFlags>
</PropertyGroup>

<!-- Versions -->
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-multithreaded
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!--
net10.0, like the rest of the solution. Nothing here is loaded by the tool, so this follows
global.json, which is also the framework the test harness builds its throwaway project for.
net10.0, like the rest of the solution. Nothing here is loaded by the tool. The test harness
builds its throwaway project for the framework global.json pins instead, and RollForward lets
these tests run where only that SDK's runtime is installed, such as the dev container.
-->
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>
<RollForward>Major</RollForward>
<!-- See the analyzer project: FSharp.Analyzers.SDK cannot restore under the repository's
central package management, so these versions live here. -->
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
Expand Down
20 changes: 11 additions & 9 deletions analyzers/Fantomas.Analyzers.Tests/TestHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,27 @@ open FSharp.Analyzers.SDK.Testing
/// it, which takes long enough that doing it per test would dominate the run. Every test in this
/// assembly analyzes a snippet against the same empty project, so one set is built for all of them.
///
/// The framework has to be one the machine can build. net10.0 is what `global.json` pins, so it is
/// The framework has to be one the machine can build. net11.0 is what `global.json` pins, so it is
/// present wherever this repository builds at all. It was net8.0 first, which passed on a developer
/// machine with an old SDK still installed and failed in the dev container, where only .NET 10
/// lives.
/// machine with an old SDK still installed and failed in the dev container, where only one SDK
/// lives. The same happened again on net10.0 once the SDK moved to 11, so keep this in step with
/// `global.json` rather than with the framework the projects target.
let mutable private projectOptions: FSharpProjectOptions = FSharpProjectOptions.zero

[<SetUpFixture>]
type ProjectOptionsFixture() =
[<OneTimeSetUp>]
member _.Setup() : Task =
task {
let! fresh = mkOptionsFromProject "net10.0" []
let! fresh = mkOptionsFromProject "net11.0" []

// The helper builds a bare class library, so its command line is a fresh project's
// defaults. Of everything this repository adds in Directory.Build.props, only
// `--strict-indentation+` reaches the parser, so a snippet is held to the same standard
// as the code the rules run over. `--realsig+` and the `--test:` switches are for later
// compiler phases and cannot change a tree, and LangVersion is never set here at all, as
// a design time build of Fantomas.Core confirms.
// defaults. Strict indentation is the only mode the compiler in SDK 11 has, but the
// FSharp.Compiler.Service the analyzers SDK brings along is older and still defaults to
// the lenient one, so ask for it and a snippet is held to the same standard as the code
// the rules run over. `--realsig+`, the one flag left in Directory.Build.props, is for a
// later compiler phase and cannot change a tree, and LangVersion is never set here at
// all, as a design time build of Fantomas.Core confirms.
let options: FSharpProjectOptions =
{ fresh with
OtherOptions = Array.append fresh.OtherOptions [| "--strict-indentation+" |]
Expand Down
2 changes: 1 addition & 1 deletion analyzers/Fantomas.Analyzers/Fantomas.Analyzers.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</ItemGroup>
<ItemGroup>
<!-- Must track the fsharp-analyzers version pinned in .config/dotnet-tools.json. -->
<PackageReference Include="FSharp.Analyzers.SDK" Version="0.39.1" />
<PackageReference Include="FSharp.Analyzers.SDK" Version="0.39.2" />
<PackageReference Include="FSharp.Core" Version="10.1.400" />
</ItemGroup>
</Project>
10 changes: 10 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,11 @@ pipeline "Analyze" {
stage "RestoreSolution" { run "dotnet restore --tl" }
stage "BuildAnalyzers" { run buildLocalAnalyzers }
stage "Analyze" {
// fsharp-analyzers targets the previous runtime and loads MSBuild from the SDK that
// global.json picks. The host never rolls a release app onto a prerelease runtime while
// a release one is installed, so an RC SDK needs this or the tool starts on the old
// runtime and fails to load the SDK's assemblies.
envVars [| "DOTNET_ROLL_FORWARD_TO_PRERELEASE", "1" |]
run (fun ctx ->
[
for project: string in projectsToAnalyze do
Expand All @@ -520,6 +525,11 @@ pipeline "AnalyzeChanged" {
stage "BuildAnalyzers" { run buildLocalAnalyzers }

stage "Analyze" {
// fsharp-analyzers targets the previous runtime and loads MSBuild from the SDK that
// global.json picks. The host never rolls a release app onto a prerelease runtime while
// a release one is installed, so an RC SDK needs this or the tool starts on the old
// runtime and fails to load the SDK's assemblies.
envVars [| "DOTNET_ROLL_FORWARD_TO_PRERELEASE", "1" |]
run (fun ctx ->
async {
let! files = changedFiles ctx
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.400",
"version": "11.0.100-rc.1.26425.128",
"rollForward": "latestMinor"
}
}
2 changes: 2 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
dotnet = "11.0.100-rc.1.26425.128"