-
Notifications
You must be signed in to change notification settings - Fork 73
Partial configuration #811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
33f608d
7205c88
6c51350
8e5ca2c
29312db
b8974d1
a0977fc
5360bb6
c470525
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "typePrefixing": { | ||
| "enabled": true, | ||
| "config": { | ||
| "mode": "Always" | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -424,22 +424,28 @@ module Lint = | |
|
|
||
| /// Gets a FSharpLint Configuration based on the provided ConfigurationParam. | ||
| let private getConfig (configParam:ConfigurationParam) = | ||
| match configParam with | ||
| | Configuration config -> Ok config | ||
| | FromFile filePath -> | ||
| try | ||
| Configuration.loadConfig filePath | ||
| |> Ok | ||
| with | ||
| | ex -> Error (string ex) | ||
| | Default -> | ||
| let getDefault () = | ||
| try | ||
| Configuration.loadConfig "./fsharplint.json" | ||
| |> Ok | ||
| with | ||
| | :? System.IO.FileNotFoundException -> | ||
| Ok Configuration.defaultConfiguration | ||
| | ex -> Error (string ex) | ||
|
|
||
| match configParam with | ||
| | Configuration config -> Ok config | ||
| | FromFile filePath -> | ||
| try | ||
| match getDefault () with | ||
| | Ok defaultConfig -> | ||
| let partialConfig = Configuration.loadConfig filePath | ||
| Configuration.combineConfigs defaultConfig partialConfig |> Ok | ||
| | Error(_) as err -> err | ||
| with | ||
| | ex -> Error (string ex) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @webwarrior-ws why are you swallowing the exception here? (BTW, is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That is what original code was doing (catching exception and putting it into Error). I assume it was done because
|
||
| | Default -> | ||
| getDefault () | ||
|
|
||
| /// Lints an entire F# project by retrieving the files from a given | ||
| /// path to the `.fsproj` file. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.