Live data from Hacker News

GitHub Super Linter: one linter to rule them all

github.blog

291–300 of 360 posts

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

#291

Earlier quoted context omitted.

Many linters have built-in auto-fix features like what you describe. (eslint, for example)

rubocop -a For the win.

It would be nice if Rubocop didn’t need as much customization as it does, because it promotes styles that violate everything I have done in my 18 years of writing Ruby.

Some of its defaults? Fine, whatever. Others? They’re just _wrong_.

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

#292

Earlier quoted context omitted.

One of the hills I am willing to die on is auto-formatting. Code formatting is easily automated to an acceptable level, and people's personal preferences are subjective. I like to solve interesting problems, and concentrate on crafting high quality software. Manual code formatting contributes to neither of these disciplines. Code formatting is BORING robot work, not human work. Total pointless drudgery. Toiling away…

Agreed. I adopted the Wes Bos approach (drive Prettier from ESLint) and it's fantastic.

Any links? I only use it for react. I found eslint auto fix works well enough for node etc

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

#293
post #263

Earlier quoted context omitted.

Wouldn't having the autoformatter run as a pre-commit hook alleviate this issue? (This is assuming you had already cleaned up all of the currently checked in code with said autoformatter)

Most autoformatters are under active development, and updates to them often causes changes in their behaviour. So you have to have all devs agree on the precise version of the formatter used, and even then you still need to do regular commits that contain nothing but a run of the newest version of the formatter on the codebase, which sadly destroys long term git blame.

Chromium has a presubmit that enforces that code is autoformatted. However, it only enforces this for changed lines, and in practice, it works pretty well.

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

#294
post #114

Earlier quoted context omitted.

What do you dislike about bugs being highlighted as you type, rather than first having to run your code?

> What do you dislike about bugs being highlighted as you type many things "highlighted as you type" aren't "bugs". let greeting = "Hello " + user.name; Auto-fixing immediately flags this with "DAMN YOU USE A CONST!!!!" (multiple red squiggles that I have to hover and review). but... I might be making a change to it a few minutes later... but I've got some damn visual shit flashing in my eyes that "USE A CONST" conca…

The funniest part about that particular example is that it's highly likely you're using babel to support old browsers, and the compiled version just switches it back to string concatenation.

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

#295

Earlier quoted context omitted.

One of the hills I am willing to die on is auto-formatting. Code formatting is easily automated to an acceptable level, and people's personal preferences are subjective. I like to solve interesting problems, and concentrate on crafting high quality software. Manual code formatting contributes to neither of these disciplines. Code formatting is BORING robot work, not human work. Total pointless drudgery. Toiling away…

I don’t know. I feel formatting choice can carry information and removing that information for conformity might be not worth it.

Huge plus!

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

#296

Earlier quoted context omitted.

You're not the only one. As a freelance/contractor, my environments change, often daily/weekly. I routinely switch between Java, PHP, Vue, React and some other tools. Doesn't matter WHAT I do, I end up having some stupid red squiggles telling me I can't use "double-quotes" or that I can't use 'single-quotes', depending on context. Multiple languages and 'community standards' conflict with each other, and I'm always c…

> It does mean that some people who place a high value on standards and listing and visual style are placated. This times a million. It doesn't help that the advocates of linting are so dogmatic about the whole idea (as demonstrated so colorfully in this thread and this sub-thread in particular). I mean, I understand why. Linting is an all or nothing type of thing. But I'm still going to remember the lint-advocate as…

Honestly, I cannot imagine a larger waste of my time than a colleague critiquing code format in a code review. And of the colleague's time. For this complaint of no value whatsoever, they have stalled the merge by whatever the average latency of their code review is. At the very least I have to wait for them to look at it again to see my response that I will not accept the style suggestion.

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

#298
post #279

Earlier quoted context omitted.

> It decides to undo your work What you're missing here is that you're supposed to be using it all along, all the time. Format on save. Format on commit. Format on server pipelines. Format all the time. It can never 'undo' anything if it's what's providing the formatting in the first place.

Thats what im talking about. If you add text to a line, and it goes over a length, it will reformat a jsx element into about 5 lines instead of 1. Similarly, when you add more than it needs because you want consistency, or know youll add more, and the formatter runs, often it undoes your work.

If you really want 5 lines, add a dummy // in there and will be forced to use 5 instead of 1. Dirty hack, but it works.

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

#299
I don't understand why there's any innovation around linters. To set them up as a PR hook, you literally just run a single linter command and check the status code. Why use something like this, or the absolutely horrible tool Codeclimate? Linting is a solved problem and easy to set up, and linting rules should be a per-TEAM decision to empower teams to solve their own problems.

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

#300

Earlier quoted context omitted.

I'm strongly against over-bearing autoformatters. In my experience a little hand crafting tweaks to formatting go a long way to increasing understandability. It feels like a lot of people are having issues with bikeshedding and they're using enforced autoformatters to impose their will and stifle debate they may not like. Not arguing about style is nice, but having to resort to this brutalist architecture style of co…

i completely agree with you. i think the people who advocate for auto-formatters must not be very skilled at using their text-editors and/or don't put enough attention on readability/understandability. i'm happy with linters and command line tools to auto-format when you explicitly call for it, like `eslint --fix`; i'm just not on board with the formatter running on git hooks or in whatever automated workflow. almost…

I swear by auto-formatters, and I've always been good at making readable code. I love auto-formatters because it makes everyone else's code readable too even if they're bad at formatting it themselves.
Post reply on HN