-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
devcontainer support #3485
Comments
The .devcontainer file in MegaLinter is an inheritance from SuperLinter and i'm not sure it ever worked It is possible to use MegaLinter as pre-commit ( @Kurt-von-Laven does it a lot ^^ ) , according to the documentation: https://megalinter.io/latest/mega-linter-runner/#pre-commit-hook About devcontainer + pre-commit + env variable.... as i'm not a devcontainer user, I'm sorry but on my side I have no answer :( |
I have written a bit of CMake code to run MegaLinter from within a devcontainer on code that is either mounted as a volume or bind mounted. The respective code can be found here: https://github.com/philips-software/amp-embedded-infra-lib/blob/main/cmake/emil_docker_tools.cmake. It should be fairly trivial to extract it to any type of language or scripting that you would like to use it in. One detail: for the bind mount scenario you need to pass in an environment variable LOCAL_WORKSPACE_FOLDER in your devcontainer.json (I add this by default to all our devcontainers https://github.com/philips-software/amp-devcontainer). "remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
} |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
@rjaegers would you like to update the .devcontainer of MegaLinter to see if it works ? :) |
We are using devcontainers and want to run megalinter from a pre-commit, but devcontainer mounts the workspace repo to a folder in the devcontainer at location "/workspace/reponame" but megalinter is not aware of this mount inside the devcontainer. Is there a way to run megalinter from a pre-commit hook within the devcontainer and pass in an environment variable with the original filesystem mount location ?
The text was updated successfully, but these errors were encountered: