From bceef3ece3393da7e8adddf7d48b895c83ba6713 Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 8 Nov 2023 11:44:52 +0100 Subject: [PATCH 1/2] Add notes on getting started. --- README.md | 12 +++++++++--- docs/index.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 74f71ac..23c12e0 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,17 @@ # Ionide.Analyzers +[![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/Ionide.Analyzers?style=flat-square)](https://www.nuget.org/packages/Ionide.Analyzers/absoluteLatest) + An fsharp community project containing [analyzers](https://ionide.io/FSharp.Analyzers.SDK/). -## Getting started +## Running these analyzers + +To run these analyzers you need to download the [fsharp-analyzers tool](https://www.nuget.org/packages/fsharp-analyzers) and this [NuGet package](https://www.nuget.org/packages/Ionide.Analyzers/absoluteLatest). +Learn more getting started in the [SDK documentation](https://ionide.io/FSharp.Analyzers.SDK/content/Getting%20Started%20Using.html) or follow this [quick start guide](https://ionide.io/ionide-analyzers/#Quick-start). + +## Getting started contributing! -Run `dotnet fsi build.fsx` to perform a local CI build. -Otherwise run `dotnet tool restore` and `dotnet restore` to download all the dependencies. +Get started in no time using our [docs](https://ionide.io/ionide-analyzers/content/contributions.html)! ## Running the documentation diff --git a/docs/index.md b/docs/index.md index 20c813d..fef0478 100644 --- a/docs/index.md +++ b/docs/index.md @@ -2,4 +2,49 @@ Welcome to the Ionide Analyzers project. +## Quick start + +In its simplest form, running analyzers requires running the [fsharp-analyzers tool](https://www.nuget.org/packages/fsharp-analyzers) and pass your `*.fsproj` and a folder that contains analyzers binaries. + +```shell +# Create a new manifest if you don't have one +dotnet new tool-manifest + +# Install the local tool +dotnet tool install fsharp-analyzers + +# Execute the tool, run dotnet fsharp-analyzers --help for more options. +dotnet fsharp-analyzers --project ./src/MyProject.fsproj --analyzers-path /var/some-folder +``` + +Of course, the `--analyzers-path` is a bit tricky. We need to download the binary and find them somehow. + +You can add a NuGet reference to your project: + +```xml + + all + runtime; build; native; contentfiles; analyzers + +``` + +This will download the package to our local NuGet cache. +*But how do we find that local path?* + +Starting `dotnet 8 RC 2`, we can [evaluate an MSBuild property](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-rc2/#msbuild-simple-cli-based-project-evaluation) which NuGet restore creates for us. + +> dotnet build ./src/MyProject.fsproj --getProperty:PkgIonide_Analyzers + +`PkgIonide_Analyzers` comes from the [{projectName}.projectFileExtension.nuget.g.props](https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#restore-outputs) file. + +This can yield + +> C:\Users\username\\.nuget\packages\ionide.analyzers\0.1.1 + +And we can use that path to pass to the tool: + +> dotnet fsharp-analyzers --project ./src/MyProject.fsproj --analyzers-path C:\Users\username\\.nuget\packages\ionide.analyzers\0.1.1 + +## Contribute! + Learn how to [get started contributing]({{fsdocs-next-page-link}})! From f7cb8da717fd5116024c7370e90d54041e07f70a Mon Sep 17 00:00:00 2001 From: Florian Verdonck Date: Wed, 8 Nov 2023 13:15:26 +0100 Subject: [PATCH 2/2] Update README.md Co-authored-by: dawe --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 23c12e0..f420912 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ An fsharp community project containing [analyzers](https://ionide.io/FSharp.Anal ## Running these analyzers To run these analyzers you need to download the [fsharp-analyzers tool](https://www.nuget.org/packages/fsharp-analyzers) and this [NuGet package](https://www.nuget.org/packages/Ionide.Analyzers/absoluteLatest). -Learn more getting started in the [SDK documentation](https://ionide.io/FSharp.Analyzers.SDK/content/Getting%20Started%20Using.html) or follow this [quick start guide](https://ionide.io/ionide-analyzers/#Quick-start). +Learn more on getting started in the [SDK documentation](https://ionide.io/FSharp.Analyzers.SDK/content/Getting%20Started%20Using.html) or follow this [quick start guide](https://ionide.io/ionide-analyzers/#Quick-start). ## Getting started contributing!