GithubHelp home page GithubHelp logo

Comments (9)

dillonkearns avatar dillonkearns commented on May 18, 2024

Hey @xtian, thanks for starting the discussion. I don't think I can commit to eliminating unused imports because it would increase the complexity of the code quite a bit. There may be some low hanging fruit to reduce a few cases but I don't think that eliminating them entirely is something that is likely to happen. The tradeoff of the code being more bug-prone and difficult to maintain would be a hard one to make.

Is there a reason that this important for you/your team? Could you elaborate a little on what your use case is for this? Do you use it in your CI build as a sort of linting process and fail if there are warnings?

from elm-graphql.

dillonkearns avatar dillonkearns commented on May 18, 2024

And of course if there were some nice automated tool to remove these I would gladly run it after the code generation, but unfortunately elm-format doesn't provide a flag or anything to do this (it was discussed briefly in avh4/elm-format#135). And I haven't seen any other tools to do this (besides some tools for the Atom editor).

from elm-graphql.

xtian avatar xtian commented on May 18, 2024

Is there a reason that this important for you/your team? Could you elaborate a little on what your use case is for this? Do you use it in your CI build as a sort of linting process and fail if there are warnings?

We do have a CI check for unused imports, but we exclude the Api.* modules from it. This is mainly a development inconvenience since on a clean build the terminal is filled with several screens-worth of warnings from the generated modules. Ideally we would only see warnings from non-generated code so we could fix them.

from elm-graphql.

dillonkearns avatar dillonkearns commented on May 18, 2024

@xtian how do you exclude Api.* from the CI check? Could something similar be used for the dev environments? If it were me I would be using the exact same script on both to make sure that things are good in dev before I push.

from elm-graphql.

xtian avatar xtian commented on May 18, 2024

@dillonkearns No, the warnings are from the Elm compiler. As far as I know there's no way to disable warnings there. The tool we use on CI is elm-analyse which has a config for ignored file paths.

from elm-graphql.

dillonkearns avatar dillonkearns commented on May 18, 2024

Ah, okay gotcha, thanks for clarifying. Again I don't think I can commit to this as the tradeoff for code maintainability and complexity would be pretty serious and there are some other higher priorities, but I will certainly keep this in mind.

from elm-graphql.

xtian avatar xtian commented on May 18, 2024

Cool, thanks! Also, the idea of doing this as a second pass in some tool is interesting. I may look into implementing that.

from elm-graphql.

dillonkearns avatar dillonkearns commented on May 18, 2024

Yeah, that would definitely be ideal if some tool took care of it.

from elm-graphql.

dillonkearns avatar dillonkearns commented on May 18, 2024

If it's alright with you @xtian, I'll close this issue for now. I'll keep this in mind though and I'm more than happy to revisit this later.

from elm-graphql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.