Using MEGALINTER_FILES_TO_LINT #2924
-
I'm running Mega Linter is a separate repo and clone the remote repo to check during runtime. Currently, the validation works fine, but Megalinter processes all files in the repo, not just the ones that are changed. I can't use VALIDATE_ALL_CODEBASE because I'm pulling the code from another repo. An alternative approach seems to be the option MEGALINTER_FILES_TO_LINT. I pass a string of files to lint and I should be good. For example, I tried to pass 'scripts/Update-Variables.ps1' for MEGALINTER_FILES_TO_LINT. However, when Megalinter starts linting, it looks for the files I passed in the /tmp/lint folder and cannot find them. Below is a snippet from the log that shows Megalinter is adding /tmp/lint to the search path:
How can I make sure Megalinter looks for the files in /CheckMe? My code is:
The folder structure on my agent looks like this: ├── CheckMe |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
I haven't tried using MegaLinter that way, but my first instinct would be to set |
Beta Was this translation helpful? Give feedback.
-
Thank Kurt, that did the trick. I was looking at it the wrong way and tried /CheckMe. Using /tmp/lint/Checkme works, but the downside is that all config files and custom rule sets in the root of the repo cannot be found anymore and need to be copied to the the root of the CheckMe folder. Alternative is to add Checkme/ to every file to be checked instead. |
Beta Was this translation helpful? Give feedback.
-
@GitHubUser1339 can you try with beta version ? -> #2744 |
Beta Was this translation helpful? Give feedback.
-
I'm currently using the /tmp/lint as default workspace (e.g. I don't specify) and I add the 'CheckMe/' prefix to the changed files path I'd like to check. This setup works for me. |
Beta Was this translation helpful? Give feedback.
I haven't tried using MegaLinter that way, but my first instinct would be to set
DEFAULT_WORKSPACE: /tmp/lint/CheckMe
.