Skip to content
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

MegaLinter reports 1 error found even when yamlint reports multiple errors #3195

Closed
james-garriss opened this issue Dec 7, 2023 · 1 comment · Fixed by #3198
Closed

MegaLinter reports 1 error found even when yamlint reports multiple errors #3195

james-garriss opened this issue Dec 7, 2023 · 1 comment · Fixed by #3198
Labels
bug Something isn't working

Comments

@james-garriss
Copy link

Describe the bug

When MegaLinter runs yamllint, and yamllint reports multiple errors, MegaLinter reports that there was only 1 error.

To Reproduce

  1. Use MegaLinter to lint the MegaLinter YAML file and the yamlint YAML file.
  2. Add a few linting issues, like extra blank lines.
  3. Setup a MegaLinter config file that only runs yamllint.
ENABLE_LINTERS:
  - YAML_YAMLLINT
  1. Run MegaLinter.
  2. See that MegaLinter reports that there is only 1 error, but yamllint actually finds multiple errors.

Note: This appears to be the same error that someone else previously reported about Bandit.

Expected behavior

I would expect MegaLinter to report the sum total number of errors that yamllint finds.

Screenshots

❌ Linted [YAML] files with [yamllint]: Found 1 error(s) - (0.21s)
- Using [yamllint v1.33.0] https://megalinter.io/7.6.0/descriptors/yaml_yamllint
- MegaLinter key: [YAML_YAMLLINT]
- Rules config: [/.yamllint.yml]
- Number of files analyzed: [4]
--Error detail:
.mega-linter.yml
  6:1       error    too many blank lines (1 > 0)  (empty-lines)

megalinter.yml
  17:1      error    trailing spaces  (trailing-spaces)
  63:21     error    no new line character at the end of file  (new-line-at-end-of-file)

yamllint.yml
  35:19     error    no new line character at the end of file  (new-line-at-end-of-file)
@james-garriss james-garriss added the bug Something isn't working label Dec 7, 2023
nvuillam added a commit that referenced this issue Dec 9, 2023
@nvuillam
Copy link
Member

nvuillam commented Dec 9, 2023

@james-garriss good catch, thanks for reporting, PR is on the way :)

nvuillam added a commit that referenced this issue Dec 9, 2023
* Fix count of yamllint errors

Fixes #3195

* [MegaLinter] Apply linters fixes

---------

Co-authored-by: nvuillam <nicolas.vuillamy@cloudity.com>
Co-authored-by: nvuillam <nvuillam@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants