Skip to content
Open
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
30 changes: 26 additions & 4 deletions .github/workflows/build+test+deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,28 @@ jobs:
- name: Run FSharpLint on itself
run: make selfcheck

testToolInvocation:
needs: buildAndTest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore tools
run: dotnet tool restore
- name: Build and pack
run: dotnet fsi build.fsx -t Pack
- name: Remove global.json to allow using .NET 10 SDK (for dnx)
run: rm --force global.json
- name: Run fsharplint as tool using dnx
run: dnx fslint lint ./src/FSharpLint.Console/FSharpLint.Console.fsproj --source ./out/ --prerelease --yes --interactive false

packReleaseBinaries:
needs: buildAndTest
Expand Down Expand Up @@ -161,11 +183,11 @@ jobs:
</configuration>
EOF
- name: Install FSharpLint from downloaded binaries
run: dotnet tool install --global dotnet-fsharplint --prerelease --framework net8.0
run: dotnet tool install --global fslint --prerelease --framework net8.0
- name: Add .NET tools to PATH
run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
- name: Lint FSharpLint.Console project (net8.0 only)
run: dotnet fsharplint lint ./src/FSharpLint.Console/FSharpLint.Console.fsproj --framework net8.0
run: fslint lint ./src/FSharpLint.Console/FSharpLint.Console.fsproj --framework net8.0

testReleaseBinariesWithDotNet10:
needs: packReleaseBinaries
Expand Down Expand Up @@ -195,8 +217,8 @@ jobs:
</configuration>
EOF
- name: Install FSharpLint from downloaded binaries
run: dotnet tool install --global dotnet-fsharplint --prerelease
run: dotnet tool install --global fslint --prerelease
- name: Add .NET tools to PATH
run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
- name: Lint FSharpLint.Console project
run: dotnet fsharplint lint ./src/FSharpLint.Console/FSharpLint.Console.fsproj
run: fslint lint ./src/FSharpLint.Console/FSharpLint.Console.fsproj
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The [docs](http://fsprojects.github.io/FSharpLint/) contain an overview of the t

Package | Latest Stable Version | Latest Version (including Pre-Releases)
------- | --------------------- | ----------------------------------------
[dotnet tool](https://www.nuget.org/packages/dotnet-fsharplint/) | [![NuGet Status](http://img.shields.io/nuget/v/dotnet-fsharplint.svg?style=flat)](https://www.nuget.org/packages/dotnet-fsharplint/) | [![NuGet Status](http://img.shields.io/nuget/vpre/dotnet-fsharplint.svg?style=flat)](https://www.nuget.org/packages/dotnet-fsharplint/)
dotnet tool | [![NuGet Status](http://img.shields.io/nuget/v/dotnet-fsharplint.svg?style=flat)](https://www.nuget.org/packages/dotnet-fsharplint/) | [![NuGet Status](http://img.shields.io/nuget/vpre/fslint.svg?style=flat)](https://www.nuget.org/packages/fslint/)
[API](https://www.nuget.org/packages/FSharpLint.Core/) | [![NuGet Status](http://img.shields.io/nuget/v/FSharpLint.Core.svg?style=flat)](https://www.nuget.org/packages/FSharpLint.Core/) | [![NuGet Status](http://img.shields.io/nuget/vpre/FSharpLint.Core.svg?style=flat)](https://www.nuget.org/packages/FSharpLint.Core/)

## How to build
Expand Down
18 changes: 13 additions & 5 deletions docs/content/how-tos/install-dotnet-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,24 @@ category: how-to
menu_order: 1
---

# Installing as dotnet tool
# Running fsharplint

The console application is a wrapper around the linter. For basic usage, just run `dnx fslint lint <input>`, where `input` can be an fsproj, sln, fs, fsx file, or a string of source code. This will install (if run for the first time) and run fsharplint.

Run `dnx fsharplint --help` for full usage information.

# Installing and running on .NET versions older than 10.0

## Installing as dotnet tool

The linter can be [installed as a dotnet tool](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-install).

Install as a global tool: `dotnet tool install -g dotnet-fsharplint`.
Install as a global tool: `dotnet tool install -g fslint`.

Install as tool to specific directory: `dotnet tool install --tool-path <my_directory> dotnet-fsharplint`
Install as tool to specific directory: `dotnet tool install --tool-path <my_directory> fslint`

## Running the Console Application

The console application is a wrapper around the linter. For basic usage, just run `dotnet fsharplint lint <input>`, where `input` can be an fsproj, sln, fs, fsx file, or a string of source code.
If installed as a local tool, run `dotnet fslint lint <input>`

Run `dotnet fsharplint --help` for full usage information.
If installed as a global tool, run it as `fslint lint <input>`.
2 changes: 1 addition & 1 deletion src/FSharpLint.Console/FSharpLint.Console.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageTags>F#;fsharp;lint;FSharpLint;fslint;cli</PackageTags>
<PackageType>DotNetCliTool</PackageType>
<PackAsTool>true</PackAsTool>
<AssemblyName>dotnet-fsharplint</AssemblyName>
<AssemblyName>fslint</AssemblyName>
<RootNamespace>FSharpLint.Console</RootNamespace>
<IsPackable>true</IsPackable>
<RollForward>LatestMajor</RollForward>
Expand Down
2 changes: 1 addition & 1 deletion tests/FSharpLint.FunctionalTest/TestConsoleApplication.fs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module Tests =
|> Seq.sortByDescending _.Name
|> Seq.tryHead
match dllDir with
| Some dir -> dir.FullName </> "dotnet-fsharplint.dll"
| Some dir -> dir.FullName </> "fslint.dll"
| None -> failwithf "No target framework folder found in %s" binDir.FullName

let startInfo = ProcessStartInfo
Expand Down
Loading