Skip to content
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

Provide default record values for Lint API #105

Closed
dungpa opened this issue Jul 5, 2015 · 2 comments
Closed

Provide default record values for Lint API #105

dungpa opened this issue Jul 5, 2015 · 2 comments

Comments

@dungpa
Copy link
Contributor

dungpa commented Jul 5, 2015

We currently use:

Lint.lintParsedFile 
                    { FinishEarly = None
                      Configuration = None //Configuration.defaultConfiguration
                      ReceivedWarning = None }
                    { Ast = ast
                      Source = source
                      TypeCheckResults = checkResults.GetCheckResults() }

It would be great if OptionalLintParameters record type has a Default property (providing minimally useful config) so that we could just use Lint.lintParsedFile OptionalLintParameters.Default ....

Any customization can be easily done with { OptionalLintParameters.Default with ... }.

The same thing could be applied for FSharpLint.Framework.Configuration.Configuration record type. At a first glance, it's hard for clients to figure out what should be passed in.

@duckmatt
Copy link
Collaborator

duckmatt commented Jul 5, 2015

Thanks that's a good suggestion. I've added a Default property.

Configuration = None will use Configuration.defaultConfiguration when linting (I've just added this to the xml doc for the record) so there is no need to pass in a config unless it's custom (custom configs can be loaded using the functions in FSharpLint.Application.ConfigurationManagement in lint.fsi)

@dungpa
Copy link
Contributor Author

dungpa commented Jul 6, 2015

Great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants