Git Product home page Git Product logo

Comments (6)

mpeterv avatar mpeterv commented on September 15, 2024 2

@X-Raym try modifying file called .luacheckrc in the root of your project.

from luacheck.

mpeterv avatar mpeterv commented on September 15, 2024 1

@X-Raym hi, you can pass -d to luacheck or add allow_defined = true to luacheck config called .luacheckrc. Alternatively, pass the globals you define to --globals.

from luacheck.

mpeterv avatar mpeterv commented on September 15, 2024

I could simply add an option to filter such warnings, but I think it would be more useful to have an option(e,g, --allow-defined) which also allows accessing globals set elsewhere. E.g.

bar = {}
function bar.foo() end
...
bar.foo()

wouldn't produce warnings with such option enabled. This is actually on my (virtual) todo list, so it will be added by the next release.

from luacheck.

mpeterv avatar mpeterv commented on September 15, 2024

I've just added an option(--allow-defined/-d) on master branch. It removes all setting non-standard global variable warnings and also removes accessing undefined variable warnings for globals set elsewhere.

from luacheck.

X-Raym avatar X-Raym commented on September 15, 2024

Hi ! How can I activate this setting ?

from luacheck.

X-Raym avatar X-Raym commented on September 15, 2024

Thank you again for your quick support !

I tried to modify the file located in /usr/local/lib/luarocks/rocks-5.2/luacheck/0.15.0-1/spec/configs/projectbut without success. The same errors message are still visible.

If may be more flexible if we had buttons (or at least config settings) to toggle these behaviors right from Atom. 🎅
Maybe it could filter luacheck warnings list output rather than modifying its config file.
Just an idea, I don't know if it is possible.

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.