Live data from Hacker News

GitHub Super Linter: one linter to rule them all

github.blog

11–20 of 360 posts

Re: GitHub Super Linter: one linter to rule them all

#11
post #6
post #2

I wish this would also prevent creating PRs that don’t pass the lint rules. It reduces churn on PR reviewers.

You could use something like https://github.com/typicode/husky to prevent a push if the linter fails.

My (small) issue with git hooks, is that they need be installed everywhere for them to be 100% enforced. Works fine for small teams, but doesn’t scale that well beyond that.

Re: GitHub Super Linter: one linter to rule them all

#12
post #6
post #2

I wish this would also prevent creating PRs that don’t pass the lint rules. It reduces churn on PR reviewers.

You could use something like https://github.com/typicode/husky to prevent a push if the linter fails.

This is what we use. Husky runs linters on pre-commit to ensure everything is linted going into the repo.

Re: GitHub Super Linter: one linter to rule them all

#13
A problem I can see with this super linter is that it seems be written exclusively for GitHub Actions; there's no local install option. (I didn't read the code, maybe you can use lib/linter.sh directly, but it's certainly not directly supported.) So contributors have to rely on the CI feedback loop to see if their changes are compliant (insert fencing comic here)... Or more realistically, still use whatever linters they've been using so far, but now you have to maintain linter configs in two places.

I get why it's probably not ideal as a local tool, and integration with Status API is nice and all, but I personally prefer to see devs linting their code before pushing for review.

Correction: it can run locally in Docker, as pointed out below: https://github.com/github/super-linter/blob/master/docs/run-...

Re: GitHub Super Linter: one linter to rule them all

#14
post #11
post #6

Earlier quoted context omitted.

You could use something like https://github.com/typicode/husky to prevent a push if the linter fails.

My (small) issue with git hooks, is that they need be installed everywhere for them to be 100% enforced. Works fine for small teams, but doesn’t scale that well beyond that.

You make the hooks as part of the CI process. That's where something like husky can come in. We do this on my team.

If you're trying to enforce something locally you can definitely enforce it on CI automatically. Once people realized their PRs were failing due to linting issues they started checking them locally as well.

Re: GitHub Super Linter: one linter to rule them all

#15
> Setting up a new repository with all the right linters for the different types of code can be time consuming and tedious.

Is it? In my company I maintain a set of exemplars for all of our commonly used repository types. When someone wants to make a new one they just copy and paste stuff from one of the exemplars.

Over the years I've come to value "white box" code re-use over "black box" re-use. In my experience many projects will outgrow their tools and need custom tooling, so it makes sense to keep the black boxes tiny and copy over large tooling in a white box fashion. For example, what if I want to change the Python linter for Pylint to flake8? I'll need a separate fork of superlinter or something. I'd prefer to just edit the tooling that is build in to my project.

Re: GitHub Super Linter: one linter to rule them all

#16
post #13

A problem I can see with this super linter is that it seems be written exclusively for GitHub Actions; there's no local install option. (I didn't read the code, maybe you can use lib/linter.sh directly, but it's certainly not directly supported.) So contributors have to rely on the CI feedback loop to see if their changes are compliant (insert fencing comic here)... Or more realistically, still use whatever linters t…

Hi, there is a local run option with instructions here: https://github.com/github/super-linter/blob/master/docs/run-...

Re: GitHub Super Linter: one linter to rule them all

#17
post #13

A problem I can see with this super linter is that it seems be written exclusively for GitHub Actions; there's no local install option. (I didn't read the code, maybe you can use lib/linter.sh directly, but it's certainly not directly supported.) So contributors have to rely on the CI feedback loop to see if their changes are compliant (insert fencing comic here)... Or more realistically, still use whatever linters t…

[deleted]

Re: GitHub Super Linter: one linter to rule them all

#18
post #8

Yay for (some) Perl support! The Perl validation seems to be restricted to "compile with warnings", despite "perlcritic" being now almost 15 years old, predating both some other linters' and even some other languages' very existence. I'll try to see how feasible it'd be to add it as a ("the"?) Perl linter to be used as using just the compilation step to infer everything's fine doesn't really satisfy the role a linter…

Yes please! Feel free to open up an issue and collaborate with others to get it added! https://github.com/github/super-linter/issues

Re: GitHub Super Linter: one linter to rule them all

#19
This is great, but desperately needs a way to also fix these issues. And all functionality should run locally as well.

I imagine the latter is possible thanks to it being a docker image.

So far I've been using this script I built for similar purposes:

https://gist.github.com/silviogutierrez/3dca60a6b5b8fe214052...

Runs locally, and only on changed files against master. Fixes all my python, JS, yaml, terraform, etc. And you can run it against a single file too so I integrated it with vim to replace all my linters.

I really hope the GitHub initiative projects takes off as a standard API (à la language server) for linters and fixers. Seems every single IDE needs to reinvent a plugin for applying a specific linter.

Re: GitHub Super Linter: one linter to rule them all

#20
post #13

A problem I can see with this super linter is that it seems be written exclusively for GitHub Actions; there's no local install option. (I didn't read the code, maybe you can use lib/linter.sh directly, but it's certainly not directly supported.) So contributors have to rely on the CI feedback loop to see if their changes are compliant (insert fencing comic here)... Or more realistically, still use whatever linters t…

Hi, there is a local run option with instructions here: https://github.com/github/super-linter/blob/master/docs/run-...

Have to install docker to run a linter... Nah, thanks.
Post reply on HN