Skip to content

Commit

Permalink
Bugfix/outdated (#391)
Browse files Browse the repository at this point in the history
* no longer used since 0.13.0

* projects no longer exists

* duplicate heading

* link to Hints.html no longer exists

* generated docs

* further outdated link, fixed indentation on code example, typos
  • Loading branch information
milbrandt committed Mar 23, 2020
1 parent 63deda0 commit c5e8d54
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
FSharpLint is a style checking tool for F#. It points out locations where a set of rules on how F# is to be styled have been broken.
The tool is configurable via JSON and can be run from a console app, or as an MSBuild task. It also provides an interface to easily integrate the tool into other software.

The project aims to let the user know of problems through [matching user defined hints](http://fsprojects.github.io/FSharpLint/Hints.html) a la [HLint](http://community.haskell.org/~ndm/hlint/), and also by using custom rules written in F# similar to the rules in [Mascot](http://mascot.x9c.fr/manual.html) and [StyleCop](http://stylecop.codeplex.com/).
The project aims to let the user know of problems through [matching user defined hints](http://fsprojects.github.io/FSharpLint/rules/FL0065.html) a la [HLint](http://community.haskell.org/~ndm/hlint/), and also by using custom rules written in F# similar to the rules in [Mascot](http://mascot.x9c.fr/manual.html) and [StyleCop](http://stylecop.codeplex.com/).

The tool in use (running as an MSBuild task with TreatWarningsAsErrors set to true):

Expand Down
2 changes: 1 addition & 1 deletion docs-gen/markdown/Rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In addition to the configuration available for each rule, there are some setting
multiple rules. These are defind in the `globals` object in the base of the configuration file. The rule pages below point out any global
setting that each rule depends on. The config is as follows, but can be completely omitted to use defaults:

[lang=javascript]
[lang=javascript]
{
"globals": {
"numIndentationSpaces": 4 // number of spaces used for indentation
Expand Down
2 changes: 1 addition & 1 deletion docs-gen/markdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ On windows run `build.cmd` and on unix based systems run `build.sh`.

FSharpLint can be used in several ways:

* [Running as dotnet tool from command line](ConsoleApplication.html).
* [Running as dotnet tool from command line](DotnetTool.html).
* [In VS Code using the Ionide-FSharp plugin](https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-fsharp).
* [In other IDEs (Visual Studio, Rider) as an MSBuild Task](MSBuildTask.html).
* [In other editors through FsAutoComplete Language Server](https://github.com/fsharp/FsAutoComplete)
Expand Down
6 changes: 2 additions & 4 deletions docs-gen/markdown/rules/FL0014.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@ Using `new` to instantiate a type which does not implement `IDisposable`.

## Rationale

`new` is redundant for insantiating types which do not implement `IDisposable`.
`new` is redundant for instantiating types which do not implement `IDisposable`.

## How To Fix

Remove `new` keyword.

## Rule Settings

## Rule Settings

[lang=javascript]
{
"redundantNewKeyword": {
"redundantNewKeyword": {
"enabled": false
}
}
12 changes: 6 additions & 6 deletions docs-gen/markdown/rules/FL0065.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Example:

[lang=hint]
not true ===> false

In the example above the boolean literal `true` is used to match any F# code where `true` is applied to the `not` identifier.

##### Match Function Application and Operators
Expand All @@ -60,9 +60,9 @@ Matching function application, prefix operators, and infix operators in hints ar
not true ===> false
4 + 4 ===> 8
~x ===> someFunc x

The first rule above matches `true` (boolean literal) applied to the function `not`, the second matches two literal integers (both `4`) applied to the `+` binary operator, and the third matches an expression applied to the `~` prefix operator.

Read the below section titled "Order Of Operations" for specifying the order of application in a hint.

##### Match Lambda Functions
Expand All @@ -75,7 +75,7 @@ For example:

[lang=hint]
fun x -> x ===> id

The above hint will match a lambda that has a single argument which is an identifier and returns that identifier. `fun val -> val` would be matched, whereas `fun val -> ()` would not be matched - to match this you could use the hint: `fun _ -> ()`.

##### Order Of Operations
Expand All @@ -90,7 +90,7 @@ Below uses parentheses to match `x` applied to `not` and the result of that appl
In F# several operators are commonly used to show the order of function application, for example in F# `someFunc (not x)` could also be written as:

not x |> someFunc

The same code written as a rule `not x |> someFunc` will match the above, but it is matching against the operator so it will not match `someFunc (not x)`. However the rule `someFunc (not x)` will match both.

### EBNF of a Hint
Expand Down Expand Up @@ -172,7 +172,7 @@ This is incomplete - currently missing a few of the more detailed rules e.g. `ui

argument-wildcard = "_";

lambda-arguments = [{(argument-variable | argument-wildcard), spaces1}],
lambda-arguments = [{(argument-variable | argument-wildcard), spaces1}],
(argument-variable | argument-wildcard), [spaces]

lambda = "fun", spaces1, lambda-arguments, "->", spaces, expression;
Expand Down
16 changes: 11 additions & 5 deletions docs/Rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,18 @@ <h2><a name="Global-Configuration" class="anchor" href="#Global-Configuration">G
<p>In addition to the configuration available for each rule, there are some settings which are defined globally to maintain consistency across
multiple rules. These are defind in the <code>globals</code> object in the base of the configuration file. The rule pages below point out any global
setting that each rule depends on. The config is as follows, but can be completely omitted to use defaults:</p>
<p>[lang=javascript]
{
"globals": {
"numIndentationSpaces": 4 // number of spaces used for indentation
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="javascript">{
<span class="s">"globals"</span>: {
<span class="s">"numIndentationSpaces"</span>: <span class="n">4</span> <span class="c">// number of spaces used for indentation</span>
}
}
}</p>
</code></pre></td></tr></table>
<h2><a name="Rule-Lists" class="anchor" href="#Rule-Lists">Rule Lists</a></h2>
<p>The following rules can be specified for linting.</p>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ <h4><a name="Building-The-Tool" class="anchor" href="#Building-The-Tool">Buildin
<h4><a name="Running-The-Tool" class="anchor" href="#Running-The-Tool">Running The Tool</a></h4>
<p>FSharpLint can be used in several ways:</p>
<ul>
<li><a href="ConsoleApplication.html">Running as dotnet tool from command line</a>.</li>
<li><a href="DotnetTool.html">Running as dotnet tool from command line</a>.</li>
<li><a href="https://marketplace.visualstudio.com/items?itemName=Ionide.Ionide-fsharp">In VS Code using the Ionide-FSharp plugin</a>.</li>
<li><a href="MSBuildTask.html">In other IDEs (Visual Studio, Rider) as an MSBuild Task</a>.</li>
<li><a href="https://github.com/fsharp/FsAutoComplete">In other editors through FsAutoComplete Language Server</a></li>
Expand Down
5 changes: 2 additions & 3 deletions docs/rules/FL0014.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,18 @@ <h1><a name="RedundantNewKeyword-FL0014" class="anchor" href="#RedundantNewKeywo
<h2><a name="Cause" class="anchor" href="#Cause">Cause</a></h2>
<p>Using <code>new</code> to instantiate a type which does not implement <code>IDisposable</code>.</p>
<h2><a name="Rationale" class="anchor" href="#Rationale">Rationale</a></h2>
<p><code>new</code> is redundant for insantiating types which do not implement <code>IDisposable</code>.</p>
<p><code>new</code> is redundant for instantiating types which do not implement <code>IDisposable</code>.</p>
<h2><a name="How-To-Fix" class="anchor" href="#How-To-Fix">How To Fix</a></h2>
<p>Remove <code>new</code> keyword.</p>
<h2><a name="Rule-Settings" class="anchor" href="#Rule-Settings">Rule Settings</a></h2>
<h2><a name="Rule-Settings-1" class="anchor" href="#Rule-Settings-1">Rule Settings</a></h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="javascript">{
<span class="s">"redundantNewKeyword"</span>: {
<span class="s">"redundantNewKeyword"</span>: {
<span class="s">"enabled"</span>: <span class="k">false</span>
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/FL0065.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ <h3><a name="EBNF-of-a-Hint" class="anchor" href="#EBNF-of-a-Hint">EBNF of a Hin

argument-wildcard = "_";

lambda-arguments = [{(argument-variable | argument-wildcard), spaces1}],
lambda-arguments = [{(argument-variable | argument-wildcard), spaces1}],
(argument-variable | argument-wildcard), [spaces]

lambda = "fun", spaces1, lambda-arguments, "-&gt;", spaces, expression;
Expand Down
3 changes: 0 additions & 3 deletions src/FSharpLint.Core/Text.resx
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@
<data name="ConsoleRunTimeConfigError" xml:space="preserve">
<value>Failed while reading from config at run time, error: {0}.</value>
</data>
<data name="LintError" xml:space="preserve">
<value>Error in file {0} on line {1} starting at column {2}</value>
</data>
<data name="RulesFailwithfWithArgumentsMatchingFormatString" xml:space="preserve">
<value>`failwithf` has more arguments than were found in its format string, these further arguments will be ignored by the compiler.</value>
</data>
Expand Down
2 changes: 0 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ Project Name | Description
------------ | --------
**`FSharpLint.Core`** | Linter library, generates an assembly which can run the linter, to be used by any application which wants to lint an F# file or project. [Available on nuget](https://www.nuget.org/packages/FSharpLint.Core/).
**`FSharpLint.Console`** | Basic console application to run the linter.
**`FSharpLint.Fake`** | [FAKE](http://fsharp.github.io/FAKE/) build task to run the linter.
**`FSharpLint.MSBuild`** | MSBuild build task to run the linter.

0 comments on commit c5e8d54

Please sign in to comment.