-
-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(descriptors, lua): add selene
support
#3978
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im still trying to find the correct syntax to keep the version number updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
install: | |
cargo: | |
- clippy |
Same with npm
packages:
install: | |
npm: | |
- eslint | |
- eslint-config-airbnb | |
- eslint-config-prettier | |
- eslint-config-standard | |
- eslint-plugin-import | |
- eslint-plugin-jest | |
- eslint-plugin-node | |
- eslint-plugin-prettier | |
- eslint-plugin-promise | |
- eslint-plugin-vue | |
- "@babel/core" | |
- "@babel/eslint-parser" | |
- "@microsoft/eslint-formatter-sarif" |
But different in here, using ARG
:
install: | |
dockerfile: | |
- |- | |
# renovate: datasource=docker depName=mstruebing/editorconfig-checker | |
ARG EDITORCONFIG_EDITORCONFIG_CHECKER_VERSION=v3.0.3 | |
- FROM mstruebing/editorconfig-checker:${EDITORCONFIG_EDITORCONFIG_CHECKER_VERSION} AS editorconfig-checker | |
- COPY --link --from=editorconfig-checker /usr/bin/ec /usr/bin/editorconfig-checker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I leave it with [email protected]
or just selene
for the time being.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can try with this: #3978 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@echoix LGTM 👍
- g++ | ||
dockerfile: | ||
- | | ||
RUN cargo install --branch main --git https://github.com/Kampfkarren/selene selene |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
selene
lua linter support tolua
descriptors.#3971
Fixes #
Proposed Changes
Readiness Checklist
Author/Contributor
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance