-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
If the cspell config is in a dir then linting fails #1397
Comments
Thanks a lot for your interest and support :) Such behaviour is indeed strange... Please can you try to run your pipeline with LOG_LEVEL:DEBUG in your .mega-linter.yml file or ENV var , so we can see how exactly is called cspell with your configuration ? |
With debug enabled these are the logs: Edit: This run had the Click to expand
|
Hmm I noticed this in the logs, not sure if it is related:
Looks similar to #845 |
Such error in not related :) It seems that you proposition with os.makedirs would do the job, would you like to make a pull request ? :) |
Sure, I can make that PR. I’m not sure it will resolve the first issue - cspell does not appear to be respecting the config. All the files it found errors in are ignored in the config. If the config is at the default location the files are correctly ignored. |
As you can see in the log, your config file is called ... maybe it's a cspell issue , something like it does not understand absolute paths in -c argument ?
|
Hmmm. I think I will play around with the cspell cli locally and open an issue upstream at https://github.com/streetsidesoftware/cspell if I need to. edit: oh yeah both @Andrew-Sheridan and @andrewasheridan are me.
|
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 |
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 |
I had to put this in the mega linter config - # Excludes cspell file itself
SPELL_MISSPELL_FILTER_REGEX_EXCLUDE: cspell. So that it will ignore all types of cspell config files, because the linter reported errors in the config itself. |
Do you have a lot of banned words in your configs? Misspell tends to lean heavily towards avoiding false positives, so I am slightly surprised you had to filter out the CSpell config. |
This is my config And no I do not have lot of banned words as per verbal english usage. But I do have 71 words which are correct in the context of the project. I found out the actual cause btw - there is I saw that misspell linter executed before cspell By this I come to a realisation that in my situation config is loading properly, but I had entirely different issue. And my issue is not relevant with this issue. Sorry my bad 😅 |
Thanks for the great tool - we have been integrating megalinter to our pipelines have found it to be quite nice :)
During our initial configuration we have encountered some mild troubles with
cspell
.To reduce the number of top-level files we store linter configs in
.github/linters/
and so the cspell config is at
.github/linters/cspell.json
This causes two issues:
If we have
SPELL_CSPELL_CONFIG_FILE: .github/linters/cspell.json
then we see this in the logs:which looks great except it is followed by content that shows the config is not respected.
If we move the file to the top of the repo and adjust
SPELL_CSPELL_CONFIG_FILE
accordingly, the rules are followed and no errors / warnings are reported.If we add a step to create those dirs under
report
before running megalinter, then it does not fail.The issue might be in this block:
https://github.com/megalinter/megalinter/blob/73c41ea0e18d4bbc4f8eff9ecdfc0040cfe8ad52/megalinter/linters/CSpellLinter.py#L77-L83
which may be alleviated by including a mkdir call:
Note: We use the same location for the yaml
prettier
andyamllint
configs and they do not appear to face these issues.Our cspell config:
Thank you!
The text was updated successfully, but these errors were encountered: