Skip to content
Draft
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
2 changes: 1 addition & 1 deletion src/FSharpLint.Core/Application/Configuration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ let loadConfig (configPath:string) =
let defaultConfiguration =
let assembly = typeof<Rules.Rule>.GetTypeInfo().Assembly
let resourceName = Assembly.GetExecutingAssembly().GetManifestResourceNames()
|> Seq.find (fun n -> n.EndsWith("fsharplint.json", System.StringComparison.Ordinal))
|> Seq.find (fun n -> n.EndsWith(SettingsFileName, System.StringComparison.Ordinal))
use stream = assembly.GetManifestResourceStream(resourceName)
match stream with
| null -> failwithf "Resource '%s' not found in assembly '%s'" resourceName (assembly.FullName)
Expand Down
12 changes: 6 additions & 6 deletions src/FSharpLint.Core/Application/Lint.fs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ module Lint =
{ CancellationToken:CancellationToken option
ErrorReceived:Suggestion.LintWarning -> unit
ReportLinterProgress:ProjectProgress -> unit
Configuration:Configuration.Configuration }
Rules:Configuration.LoadedRules }

type Context =
{ IndentationRuleContext:Map<int,bool*int>
Expand Down Expand Up @@ -207,7 +207,7 @@ module Lint =
| Some(x) -> not x.IsCancellationRequested
| None -> true

let enabledRules = Configuration.flattenConfig lintInfo.Configuration
let enabledRules = lintInfo.Rules

let lines = String.toLines fileInfo.Text |> Array.map (fun (line, _, _) -> line)
let allRuleNames =
Expand Down Expand Up @@ -384,7 +384,7 @@ module Lint =
| ex -> Error (string ex)
| Default ->
try
Configuration.loadConfig "./fsharplint.json"
Configuration.loadConfig $"./{Configuration.SettingsFileName}"
|> Ok
with
| :? System.IO.FileNotFoundException ->
Expand All @@ -411,7 +411,7 @@ module Lint =

let parseFilesInProject files projectOptions =
let lintInformation =
{ Configuration = config
{ Rules = Configuration.flattenConfig config
CancellationToken = optionalParams.CancellationToken
ErrorReceived = warningReceived
ReportLinterProgress = projectProgress }
Expand Down Expand Up @@ -517,7 +517,7 @@ module Lint =

optionalParams.ReceivedWarning |> Option.iter (fun func -> func warning)
let lintInformation =
{ Configuration = config
{ Rules = Configuration.flattenConfig config
CancellationToken = optionalParams.CancellationToken
ErrorReceived = warningReceived
ReportLinterProgress = Option.defaultValue ignore optionalParams.ReportLinterProgress }
Expand Down Expand Up @@ -560,7 +560,7 @@ module Lint =
optionalParams.ReceivedWarning |> Option.iter (fun func -> func warning)

let lintInformation =
{ Configuration = config
{ Rules = Configuration.flattenConfig config
CancellationToken = optionalParams.CancellationToken
ErrorReceived = warningReceived
ReportLinterProgress = Option.defaultValue ignore optionalParams.ReportLinterProgress }
Expand Down
Loading