Skip to content

Replace Codeclimate with megalint#1122

Merged
J12934 merged 21 commits intomainfrom
megalint
May 11, 2022
Merged

Replace Codeclimate with megalint#1122
J12934 merged 21 commits intomainfrom
megalint

Conversation

@the-simmon
Copy link
Copy Markdown
Contributor

@the-simmon the-simmon commented Apr 19, 2022

This PR adds Megalinter as a local linter. Closes #739

It adds a CI workflow, and a make target lint (lints only changed files), lintfix (lints only changed files and tries to apply automatic fixes) and lintall.

An important observation:
Currently Megalint is configured to only lint changed files, but for some reason megalint compares the current branch with the newest version of the main branch. This means that a change in main after the feature branch was created will trigger the linting of that changed file in the feature branch, even though the feature branch didn't change the file.
This behavior can be observed in the result of the CI run of this branch. For example generic webhook will be linted because it was changed in the main branch, but this branch did not touch those files. (Download the ZIP at the end of the CI run page and check the spell checker report).
The number of "unnecessary" linted files will increase with the number of changes in the main branch compared to the feature branch, which means that older feature branches will be spammed with more and more unnecessary findings over time.

Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
@the-simmon the-simmon added enhancement New feature or request maintenance ci Changes to the continuous integration setup labels Apr 19, 2022
@the-simmon the-simmon self-assigned this Apr 19, 2022
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 19, 2022

MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 1 0 0.02s
✅ GIT git_diff yes no 0.16s
✅ JSON eslint-plugin-jsonc 2 0 1.45s
✅ JSON jsonlint 2 0 0.62s
✅ JSON prettier 2 0 0.49s
✅ JSON v8r 2 0 3.26s
✅ SPELL misspell 6 0 0.04s
⚠️ YAML prettier 2 1 0.48s
✅ YAML v8r 2 0 2.04s
⚠️ YAML yamllint 2 1 0.12s

See errors details in artifact MegaLinter reports on CI Job page
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

@the-simmon the-simmon changed the title Megalint Replace Codeclimate with megalint Apr 19, 2022
Makefile Outdated


.PHONY:
megalint:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
megalint:
lint:

Let's try to keep our makefile targets independent from the technology implementation

Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
@the-simmon the-simmon marked this pull request as ready for review April 29, 2022 14:06
Signed-off-by: Simon Hülkenberg <simon.huelkenberg@iteratec.com>
@J12934 J12934 merged commit ef80c61 into main May 11, 2022
@J12934 J12934 deleted the megalint branch May 11, 2022 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Changes to the continuous integration setup enhancement New feature or request maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace CodeClimate with local linters

3 participants