Git Product home page Git Product logo

Comments (5)

xpol avatar xpol commented on August 11, 2024

I mean does luacheck always have one of warning count and error count to be zero?

from luacheck.

mpeterv avatar mpeterv commented on August 11, 2024

I mean does luacheck always have one of warning count and error count to be zero?

When checking only one file, yes. I agree that it's better to have some indication on each line. When using --codes option most warnings have a label with warning code near them starting with W, e,g, source.lua:136:10: (W212) unused argument baz, you could check for that.

Perhaps it'll make even more sense to give codes to errors as well, so that a syntax error is reported like this: source.lua:2:1: (E011) expected '=' near <eof>. What do you think?

from luacheck.

xpol avatar xpol commented on August 11, 2024

👍 It would be nice that every warnings and errors has a codes.

And then format_warning and format_error_msg should have same logic and merged as one function.

from luacheck.

mpeterv avatar mpeterv commented on August 11, 2024

On master errors now also have codes. Just run luacheck with --codes option and then for each issue look for code inside parens, it will start with E for errors and with W for warnings, e.g.

Checking spec/samples/python_code.lua             1 error

    spec/samples/python_code.lua:1:6: (E011) expected '=' near '__future__'

Checking spec/samples/inline_options.lua          8 warnings / 2 errors

    spec/samples/inline_options.lua:6:16: (W211) unused function 'f'
    spec/samples/inline_options.lua:12:4: (W113) accessing undefined variable 'qu'
    spec/samples/inline_options.lua:15:1: (W113) accessing undefined variable 'baz'
    spec/samples/inline_options.lua:24:10: (W211) unused variable 'g'
    spec/samples/inline_options.lua:26:7: (W211) unused variable 'f'
    spec/samples/inline_options.lua:26:10: (W211) unused variable 'g'
    spec/samples/inline_options.lua:28:1: (E022) unpaired push directive
    spec/samples/inline_options.lua:30:4: (E023) unpaired pop directive
    spec/samples/inline_options.lua:36:1: (W541) empty do..end block
    spec/samples/inline_options.lua:37:10: (W542) empty if branch

Total: 8 warnings / 3 errors in 2 files

from luacheck.

xpol avatar xpol commented on August 11, 2024

@mpeterv 👍 thank you!

from luacheck.

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.