feat(descriptors, lua): add selene support#3978
Conversation
|
@nvuillam and what is needed as test file for a new linter? |
|
/build
|
|
|
Since updating the repo from the new linter modifies some workflow files, I need a human to run the build command. If you are on Linux, it is pip install pipx
pipx install hatch
hatch shell
hatch run build:build |
|
@echoix I ran it from a MacOS and After Do I commit all these files, right? |
|
Yep, the same files that you can see in the logs of the workflow I tried to do automatically, but couldn't. (We don't add new linters often nowadays, so it wasn't expected to work everywhere) |
About tests, let's see if the ones existing for luacheck do the work :) https://github.com/oxsecurity/megalinter/tree/main/.automation/test/lua |
|
@AlejandroSuero , I think you can factorize the installation of lua at descriptor level ( And keep at linter level only what is purely related to the linter :) Example with powershell: https://github.com/oxsecurity/megalinter/blob/main/megalinter/descriptors/powershell.megalinter-descriptor.yml |
|
@nvuillam here are the results for selene in existing tests: |
|
@AlejandroSuero can you update the test cases so they work with both luacheck and selene ? Otherwise, it's possible to create a test cases folder just for lua_selene and set property test_folder in selene descriptor, but if we can avoid that I prefer :) |
On the Do I move the |
|
With the commit 442fbf7 the test results are: Both |
The next linter (StyLua) is a Docker copy-only linter though, so in the individual linter image, the language-level install will be suboptimal. |
| - g++ | ||
| dockerfile: | ||
| - | | ||
| RUN cargo install --branch main --git https://github.com/Kampfkarren/selene selene |
There was a problem hiding this comment.
We try to use official releases, so maybe try the following:
| RUN cargo install --branch main --git https://github.com/Kampfkarren/selene selene | |
| RUN cargo install selene@0.27.1 |
There was a problem hiding this comment.
Im still trying to find the correct syntax to keep the version number updated
There was a problem hiding this comment.
For what I saw with cargo in the rust descriptor, it's just being omitted (just using the crate name):
megalinter/megalinter/descriptors/rust.megalinter-descriptor.yml
Lines 23 to 25 in 8ec5e3e
Same with npm packages:
But different in here, using ARG:
There was a problem hiding this comment.
We weren't pinning packages up until a couple weeks ago, from my push to make keeping them updatable manageable. So you'll find lots of places where they aren't implemented yet
There was a problem hiding this comment.
Do I leave it with [email protected] or just selene for the time being.
| - g++ | ||
| dockerfile: | ||
| - | | ||
| RUN cargo install --branch main --git https://github.com/Kampfkarren/selene selene |
There was a problem hiding this comment.
@nvuillam where does cargo get set up in individual linters? As it isn't being built in the PR, we don't see it fail yet
| - g++ | ||
| dockerfile: | ||
| - | | ||
| RUN cargo install --branch main --git https://github.com/Kampfkarren/selene selene |
There was a problem hiding this comment.
Im still trying to find the correct syntax to keep the version number updated
Co-authored-by: Edouard Choinière <[email protected]>
Co-authored-by: Edouard Choinière <[email protected]>
|
/build
|
|
I'm running tests of individual linters in echoix#120 |
|
Thanks again! I assure you, the StyLua is way easier to integrate, it's only a copy operation |
|
Great job @AlejandroSuero , i'll mention you in the LinkedIn post at the next MegaLinter release 😊 |
|
@nvuillam @echoix thanks for the feedback and the help. Should this be the way to copy it? https://github.com/JohnnyMorganz/StyLua?tab=readme-ov-file#docker |
|
Yes, but I think there's missing the $ for using the var |




Added
selenelua linter support toluadescriptors.#3971
Fixes #
Proposed Changes
Readiness Checklist
Author/Contributor
Reviewing Maintainer
breakingif this is a large fundamental changeautomation,bug,documentation,enhancement,infrastructure, orperformance