fsharp
fsharp copied to clipboard
Integrate FSharpLint into build
The FSharpLint tool can check F# code for common errors/improvements and can make suggestions on how to fix them. We should include this in our build, so that it runs each time a project runs.
Note: this is dependent on having a separate project for each exercise, which we will do once the .NET Core tooling is fully working.
I looked into this, but unfortunately, it appears there is a bug: https://github.com/fsprojects/FSharpLint/issues/250
With .NET Core 3.0's local tools, it seemed like a good time to revisit this.
Unfortunately I immediately ran right into another bug. (when invoking e.g. dotnet-fsharplint -f Generators.fsproj)
Another approach could be to run the tool on each source file, something like find . |grep \\.fs\$ |xargs -n 1 dotnet-fsharplint -sf, but it would be difficult to make an approach like this portable for Windows users.
@jrr Thanks for looking into this! I also saw that you submitted a PR to fix the issue. Once that is merged, we can look at how we can integrate this properly (e.g. by adding instructions to the README), do you agree?
Yep, sounds good.
Great! @jrr please give us a heads-up when the PR has been merged :)
Well, that was fast. It's merged and released.
What were you thinking for integration? Some ideas:
- Add fsharplint to each exercise's project, so that students can use it
- Build an automated analyzer using fsharplint to provide feedback to student submissions ;)
- Add a convenience script into this repo to lint everything
- Update this project to .NET Core 3.0 and add linting to CI
Add fsharplint to each exercise's project, so that students can use it
This was my primary goal: allowing students to run the linting themselves. We can then update the README template to add notes on how to run the linter.
Build an automated analyzer using fsharplint to provide feedback to student submissions ;)
This would be super awesome. The analyzer will have to do more than the linter later, but basing it on just the linter would already be a great start.
Add a convenience script into this repo to lint everything
Sounds like a plan!
Update this project to .NET Core 3.0 and add linting to CI
Do you mean to also update the exercises? That is an option indeed. What do you think about that @robkeim?
All in all many great opportunities. Let me know which ones you'd like to look into.
This sounds like some cool stuff! Regarding this:
Update this project to .NET Core 3.0 and add linting to CI
Do you mean to also update the exercises? That is an option indeed. What do you think about that @robkeim?
I don't see any reasons that we should not upgrade to .NET Core 3.0 particularly if we have an occasion to leverage new functionality.
I don't see any reasons that we should not upgrade to .NET Core 3.0 particularly if we have an occasion to leverage new functionality.
Cool. I've created an issue.