ionide / FSharp.Analyzers.SDK

Library for building custom analyzers for F# / FSAC
http://ionide.io/FSharp.Analyzers.SDK/
MIT License
74 stars 21 forks source link

Accept direct fsc arguments as input. #129

Closed nojaf closed 10 months ago

nojaf commented 10 months ago

The use-case for this is:

  <Target Name="Analyzer"
          DependsOnTargets="Restore;ResolveAssemblyReferencesDesignTime;ResolveProjectReferencesDesignTime;ResolvePackageDependenciesDesignTime;FindReferenceAssembliesForReferences;_GenerateCompileDependencyCache;_ComputeNonExistentFileProperty;BeforeBuild;BeforeCompile;CoreCompile">
    <PropertyGroup>
      <AnalyzersPath>&quot;$(PkgNojaf_Chad_Analyzers)\analyzers\dotnet\fs&quot;</AnalyzersPath>
    </PropertyGroup>
    <Exec Command="dotnet tool restore" />
    <Exec Command="dotnet fsharp-analyzers --fsc-args &quot;@(FscCommandLineArgs)&quot; --analyzers-path $(AnalyzersPath) --verbose --report $(MSBuildProjectDirectory)\analysis.sarif" />
  </Target>

We will add more end-user / getting starting documentation shortly.