Skip to content

Super linter #317

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

Merged
merged 18 commits into from
Nov 4, 2021
Merged

Super linter #317

merged 18 commits into from
Nov 4, 2021

Conversation

prestoncarman
Copy link
Contributor

Highlights from CHANGELOG.md

  • Added a CI workflow to lint the code base

Issues Fixed

@ianfixes
Copy link
Collaborator

If all this linter accomplishes is to complain about the existing markdown style we're using (which is valid), I'd prefer not to add it. We already have a linter for the ruby code that allows a more nuanced configuration than this tool.

@prestoncarman
Copy link
Contributor Author

A few notes:

  • This linter actually runs many linters for a variety of languages. Each linter has its own configuration file which we can individually configure.
    • It may be that we want to alter the Markdown settings.
    • We could also pick to run only certain linters. For example, we could turn off Ruby or only turn on the C++ linter.
  • The linter has been configured to only run on files that were changed in the PR.
  • When I turned on the linter for the whole repo, it reported many errors. https://github.com/prestoncarman/arduino_ci/runs/4003931830?check_suite_focus=true Some of those may be related to the cpp/arduino/avr which we should ignore similar to Added spelling CI #316.

Are there files it would be helpful to have a linter review? If so, I can configure the tool for those files. If not, then we can close this PR.

@ianfixes
Copy link
Collaborator

Don't get me wrong, I definitely like the idea of linting. I just find it weird to bring in an all-purpose linting tool ahead of any discussion about what problems we see & want to solve.

For example, the spell checker's utility was self-evident... there were a host of spelling errors, and if you had asked in advance whether the codebase had any then I probably would have doubted it.

Are there files it would be helpful to have a linter review?

I think it would be worthwhile to lint

  • the YAML files for correctness (and I'm sure there are rules for things like the Norway bug).
  • the Markdown files for a style that's aligned with what we already use (### Title instead of ** Title **, etc)
  • C++ for whatever approximates the style currently in use. Hopefully it doesn't choke on all the macros.

I'd rather tackle that as 3 separate linters, since the "super linter" is going to be a bit inflexible as to individual linter versions being used concurrently.

@prestoncarman
Copy link
Contributor Author

I have found the GitHub Action called Super-Linter easy to set up and configure. So instead of creating individual actions, I thought we could start with using this tool until it does not meet our needs. These are the individual linters that are being run to cover C++, Markdown, and YAML files.

  • cpp-lint
  • clang-format
  • markdownlint
  • YamlLint

This PR only includes linter configuration and any conflicting linting issues that need to be fixed. The linting configuration files for each language have been configured to allow the current code to pass all the tests. In the future, the configuration settings could be reviewed to see if any of those settings should be changed.

Copy link
Contributor Author

@prestoncarman prestoncarman left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback. It appears I make a few unnecessary changes for linting. The rules have been updated.

Copy link
Collaborator

@ianfixes ianfixes left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for responding to all those comments!

@jgfoster jgfoster merged commit 3d12bb7 into Arduino-CI:master Nov 4, 2021
@prestoncarman prestoncarman deleted the super-linter branch November 11, 2021 22:23
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.

Add Super Linter
3 participants