Skip to content

Optional parameters falsely flagged #328

Open

Description

@Shmew

Warnings are thrown for optional bool parameters

`x = true` might be able to be refactored into `x`.
silentHttpErrors = true

https://github.com/fsharp/FSharp.Data/blob/master/src/Net/Http.fs#L1704

Activity

  1. changed the title [-]Optional parameters falsely fla[/-] [+]Optional parameters falsely flagged[/+] on Apr 17, 2019
  2. jgardella commented on May 6, 2019

    @jgardella
    Contributor

    Hi @Shmew, thanks for the bug report. When you get a chance, could you please provide a minimum example that reproduces this issue?

  3. Shmew commented on May 15, 2019

    @Shmew
    Author
    module Example
    
    open FSharp.Data
    
    let test () =
        let uri = @"https://petstore.swagger.io/v2/pet/findByStatus?status=available"
    
        let heads = 
          [ HttpRequestHeaders.ContentLanguage HttpContentTypes.Json
            HttpRequestHeaders.Accept @"*/*"
            HttpRequestHeaders.AcceptEncoding "UTF8"
            HttpRequestHeaders.ContentType HttpContentTypes.Json
            HttpRequestHeaders.ContentEncoding "UTF8" ]
    
        Http.Request(uri, httpMethod = "GET", headers = heads, silentHttpErrors = true)
    
    ========== Linting .\Example.fs ==========
    `x = true` might be able to be refactored into `x`.
    Error in file .\Example.fs on line 14 starting at column 59
        Http.Request(uri, httpMethod = "GET", headers = heads, silentHttpErrors = true)
                                                               ^
    --------------------------------------------------------------------------------
    ========== Finished: 1 warnings ==========
    ========== Summary: 1 warnings ==========
    

    Hey @jgardella sorry for taking so long, I forgot about this.

  4. added this to the Version 1.0.0 milestone on May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions