Git Product home page Git Product logo

Comments (6)

issue-label-bot avatar issue-label-bot commented on June 5, 2024 1

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.82. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

from loguru-mypy.

kornicameister avatar kornicameister commented on June 5, 2024

@Delgan if you have something more feel free to let me know :). If there are some users already, let us know too :)

from loguru-mypy.

Delgan avatar Delgan commented on June 5, 2024

There are different possible errors "at runtime", I guess we can figure out some of them by looking at the raise statements in the loguru sources.

Here are some examples of code causing exceptions but not detected by mypy / type-hints:

  • logger.add(sys.stderr, level=-10) (negative level not allowed)
  • logger.level("FOOBAR", no=-10) (negative level not allowed)
  • logger.log(-10, "Message") (negative level not allowed)
  • logger.level("INFO", no=111) (updating the no of an existing level is not allowed)
  • logger.add("file.txt", foobar="xyz") (the open() builtin does not have a foobar argument)

There is also a whole range of "parsing" issues that I didn't listed (like parsing of color tags or rotation/retention).

from loguru-mypy.

kornicameister avatar kornicameister commented on June 5, 2024

Hmm...I think we can take some od those for later. @Delgan if you want to dive into wonderful world od mypy feel free to implement either of those 😁

from loguru-mypy.

Delgan avatar Delgan commented on June 5, 2024

Honestly, I don't think it's worth spending time implementing this. I was just throwing some ideas. 😁

from loguru-mypy.

kornicameister avatar kornicameister commented on June 5, 2024

well perhaps having levels defined as int is enough. This is how typeshed does that. Maybe colors could be done like so if for example you requre hex like color codes, we could check against that. But that might low on prio for us.
I will keep this one here. If we people start using this plugin, they will be the best judge we can get ;)

from loguru-mypy.

Related Issues (18)

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.