Skip to content

Various issues #793

@GrabCAD-Gary

Description

@GrabCAD-Gary

Hi,

I've been looking at implementing Mega-Linter in our workflows and run into several unexpected issues and questions. I'll raise them here and I can make the necessary bug reports if they turn out to be more than just me getting things wrong.

  1. I can't find a way to run spelling checkers as I expect to. Enabling CSPELL alone does nothing because it seems as though it's fed whatever files are found by other linters i.e. if I enable YAML then the .yml files are found and only those files are spell-checked. This seems very odd. Wanting to run spelling checks independantly of other checks seems like a blindingly obvious thing. Is there a way to do this?

  2. I have been unable to determine whether checking changed files only relies on GIT_DIFF, VALIDATE_ALL_CODEBASE or both. I have found no way to do it locally, although it works on GitHub correctly. No combination of those settings ever causes M-L to check changed files only when run locally.

  3. Linting stops with:

  [Text Reporter] Generated TEXT report: /tmp/lint/report/linters_logs/ERROR-YAML_PRETTIER.log
  Traceback (most recent call last):
    File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/megalinter/run.py", line 15, in <module>
    linter.run()
  File "/megalinter/MegaLinter.py", line 167, in run
    reporter.produce_report()
  File "/megalinter/reporters/ConfigReporter.py", line 103, in produce_report
    vscode_extensions_config = json.load(json_file)
  File "/usr/local/lib/python3.9/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.9/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 2 (char 3)

I had this pinned down to cspell until I found that it happens when I enable YAML as well. I checked every JSON file in the repo and none of them have any errors so this seems to be internal. I tried both dotnet and javascript flavours and both have the same issue.

  1. Generated files don't pass linting!! This is true of the .mega-linter.yml for the linters and for the GH action and others. That seems pretty poor.

  2. Linting is horribly slow for some operations. I can run GIT, YAML and SPELL and have results in about a minute using the javascript and dotnet flavours. If I run POWERSHELL it's about an hour. As I write I have GIT and JSON enabled. M-L found 1467 JSON files to lint, it's been going for over an hour and last reported

✅ Linted [JSON] files with [v8r] successfully - (2845.17s)
[Text Reporter] Generated TEXT report: /tmp/lint/report/linters_logs/SUCCESS-JSON_V8R.log

towards an hour ago. It's not usable at that rate of progress and no linter should take that long. Again, something more seems wrong especially given that they run in parallel. I did note that Docker prompted that I had files shared with WSL, presumably because I used the WSL2 back-end. I've changed that back to default which stopped Docker prompting but hasn't helped.

  1. I'm using VSCode. The name completion mentioned on the configuration page doesn't work for ENABLE_LINTERS and DISABLE_LINTERS. That's because they're not in the schema, which seems like an oversight.

Any guidance you can offer is appreciated. I may be doing things wrong somewhere. I have some settings in my .mega-linter.yml and I have tried juggling them to see if anything changes but haven't detected that it does.

Many thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions