fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Integrate FSharpLint into build

Open ErikSchierboom opened this issue 8 years ago • 9 comments

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.

ErikSchierboom avatar Feb 12 '17 09:02 ErikSchierboom

I looked into this, but unfortunately, it appears there is a bug: https://github.com/fsprojects/FSharpLint/issues/250

ErikSchierboom avatar Feb 12 '18 08:02 ErikSchierboom

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 avatar Oct 05 '19 18:10 jrr

@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?

ErikSchierboom avatar Oct 07 '19 08:10 ErikSchierboom

Yep, sounds good.

jrr avatar Oct 07 '19 18:10 jrr

Great! @jrr please give us a heads-up when the PR has been merged :)

ErikSchierboom avatar Oct 07 '19 19:10 ErikSchierboom

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

jrr avatar Oct 08 '19 02:10 jrr

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.

ErikSchierboom avatar Oct 08 '19 06:10 ErikSchierboom

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.

robkeim avatar Oct 13 '19 13:10 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.

Cool. I've created an issue.

ErikSchierboom avatar Oct 14 '19 06:10 ErikSchierboom