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

Add MegaLinter for JSON and GitHub Workflow files #572

Closed
wants to merge 1 commit into from

Conversation

bitonality
Copy link
Contributor

MegaLinter

MegaLinter is an aggregate linter that combines a huge collection of different language/format linters and consolidates their configs. It's a hard fork of SuperLinter, but I prefer MegaLinter's approach to documentation and security more than SuperLinter. If you are unfamiliar with either of these aggregate linters, you can check out MegaLinter's website (https://megalinter.io/latest/).

This PR enables linting for GitHub actions and static JSON from MegaLinter.

JSON

Lints JSON files to make sure we aren't checking in malformed configurations/settings files. Reports are served as a pull request comment and inline on the file viewer for the PR. The JSON linter has auto-fixing disabled and is set to only emit errors. JSON linting only occurs on JSON files that change within the PR being evaluated. Example below:

jsonlint fail

GitHub Actions

Lints GitHub actions yml/yaml for correct syntax and reports errors that would typically silently fail or not behave as expected. This helps cut down on the amount of iterations needed to test GitHub actions and ensures that our workflows remain robust and stable. GitHub workflow linting will evaluate on ALL workflow files when one or more is changed. This is because workflows can cross reference each other and we want to ensure that we aren't breaking workflows not involved in the pull request. Example below:

actionlint

Pull Request reporting

megalinter

MegaLinter automatically adds a report to the PR comments with links to the relevant logs so devs can easily identify where the problems are. Linting is configured to run whenever a PR is created or updated.

Future Extensibility

MegaLinter already has out of the box support for the following use cases that are relevant to us:

  • clang-format and cpplint for our C++ code.
  • luacheck for our lua scripts
  • pylint/ruff/bandit/black/flake8 for our python scripts
  • clippy for rust
  • markdownlint/remark-lint/markdown-link-check for markdown/docs validation
  • cspell/vale for spell checking in docs or in code
  • gitleaks for static secret scanning
  • git_diff for checking for merge conflict markers

@bitonality
Copy link
Contributor Author

The build is failing due to the submodule secret PAT not existing. This is expected because this workflow is being introduced from a fork.

I'm going to close this and reopen the PR from a branch within UE4SS repo.

@bitonality bitonality closed this Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant