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

feat: Introduce more linters via mega-linter #491

Closed
15 of 23 tasks
javydekoning opened this issue Aug 17, 2022 · 0 comments
Closed
15 of 23 tasks

feat: Introduce more linters via mega-linter #491

javydekoning opened this issue Aug 17, 2022 · 0 comments

Comments

@javydekoning
Copy link
Contributor

javydekoning commented Aug 17, 2022

Why

In an effort to improve maintainability we've recently introduced:

As the repository further contains samples for Terraform, Dockerfile(s), NodeJS and others introducing additional linters will help accelerate PR reviews and approvals.

It will also reduce our dependency conflicts as pylint, asteroid, yamllint etc can be removed from our requirements files.

Proposal

I'm proposing to introduce megalinter.

Why MegaLinter

Projects need to contain clean code, in order to avoid technical debt, that makes evolutive maintenance harder and time consuming.

By using code formatters and code linters, you ensure that your code base is easier to read and respects best practices

  • At each pull request it will automatically analyze all updated code in all languages
  • Reading error logs, developers learn best practices of the language they are using
  • MegaLinter documentation provides the list of IDE plugins integrating each linter, so developers know which linter and plugins to install
  • Formatting and fixes can be automatically applied on the git branch or provided in reports
  • 100% open-source and free for all uses (personal, professional, public and private repositories)
  • MegaLinter can run on any CI tool) and be run locally (Does require Docker)

Plan

Implementing this requires multiple steps.

In the first Pull request I plan to include:

  • Introduce a badge :-)
[![MegaLinter](https://github.com/<OWNER>/<REPOSITORY>/workflows/MegaLinter/badge.svg?branch=main)](https://github.com/<OWNER>/<REPOSITORY>/actions?query=workflow%3AMegaLinter+branch%3Amain)
  • Include instructions to run locally

You need to have NodeJS and Docker installed on your computer to run MegaLinter locally with MegaLinter Runner.

  • Enable the following linters:

    • CLOUDFORMATION_CFN_LINT
    • DOCKERFILE_HADOLINT
    • JSON_JSONLINT
    • JSON_PRETTIER
    • JAVASCRIPT_STANDARD
    • MARKDOWN_MARKDOWN_TABLE_FORMATTER
    • JSON_V8R
    • TERRAFORM_TFLINT
    • YAML_YAMLLINT
    • SPELL_MISSPELL

The linters above can be implemented with minimal style fixes to our code.

In future separate Pull Requests

Enabling the items below (and potentially more) will require more re-formatting. In an effort to keep Pull Requests easier to review, I'd like to split the below additions up into individual PR's:

  • BASH_EXEC
  • BASH_SHELLCHECK
  • EDITORCONFIG_CHECKER (Pending merge of: Refactor line length and minor code style changes throughout ADF #490)
    • Enforce MaxLineLength
  • PYTHON_BLACK
  • PYTHON_ISORT
  • PYTHON_PYLINT ( Requires updates to pylintrc )
    • Fix findings in samples/ which is currently excluded from pylint.
  • MARKDOWN_MARKDOWNLINT
  • MARKDOWN_MARKDOWN_LINK_CHECK
  • REPOSITORY_SECRETLINT
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

No branches or pull requests

1 participant