4 ms·
> I've never understood why people care so much about the linter settings. Source code formatting programs are not the same as lint[0] programs. The former re
by AdieuToLogic 1y ago
> I've never understood why people care so much about the linter settings.
Source code formatting programs are not the same as lint[0] programs. The former rewrites source code files such that the output is conformant with a set of layout rules without altering existing logic. The latter is a category of idempotent source code analysis programs typically used to identify potential implementation errors within otherwise valid constructs.
Some language tools support both formatting and source code analysis, but this is an implementation detail.
0 - https://en.wikipedia.org/wiki/Lint_(software) https://en.wikipedia.org/wiki/Lint_(software)
- stavros 1y agoRight, but it's obvious they meant "formatter".
- _mu 1y agoWhy build understanding when you could be pedantic?
- AdieuToLogic 1y ago> Why build understanding when you could be pedantic? Why try to share knowledge and give people an opportunity to learn the difference between two distinct concepts when they may not be aware of same? Is that pedantry or an attempt to "build understanding"?
- kristopolous 1y agoFormatters, if you want to be specific, are even worse. They slyly add git noise and pollute your audit trails by just going through and moving shit around whenever you save a file. And sometimes, they actually insert bugs - string formatting errors are my favorite example. It's for people who think good code is a about adhering to aesthetic ideologies instead of making things documented and accountable. This is most noticeable in open source contributions. Sometimes I'll get a pull request with like 2 lines of change and 120 lines of some reformating tool. You think I accept that? It's not a good idea
- rcxdude 1y agoRunning random formatters on random subsets of your code is not a good idea. If you want code in a repo to be formatted a certain way, you need to have one set of settings and enforce it, and yeah, reject anything that just has spurious formatting changes that someone else has run.
- misiek08 1y agoI’ve seen multiple repos with pre-hook and just CI running formatter on _modified_ code only. Those repos were the cleanest to date.
- galangalalgol 1y agoAvoiding that situation is what I like about formatters. As long as the language has an obvious standard like rust or go.
- thfuran 1y agoYou have it entirely backwards. Enforcing a consistent format is useful precisely because it avoids pointless git noise from different people changing formatting differently as they go.
- mvieira38 1y ago> This is most noticeable in open source contributions. Sometimes I'll get a pull request with like 2 lines of change and 120 lines of some reformating tool. This wouldn't happen nearly as much if you had a defined set of formatting rules plugged into CI instead of chaos
- bluGill 1y agoIf the rule is not enforced in ci it isn't a rule. I've made that a mantra for a long time now and it helps. For a while I did verify formatting in ci but eventually we decided that formatiing wasn't as important as getting builds done fast. We still run other test and linters in ci and if they break fix the build but formatting isn't really that imbortant so we don't care. Yes our formatting is somewhat a mess but it isn't really that bad even after a decade of agreeing not to care.
- kolme 1y agoYes, you are technically correct and yet absolutely irrelevant to the conversation, just adding meaningless noise. Also, there are many linters that also do formatting, blurring the "line" you're pointing at.
- ryandrake 1y agoThank you! I am almost going out of my mind reading this ~200 comment thread with everyone just casually saying "linter" when they mean "formatter". Do people really not distinguish between these two very different programs?
- trallnag 1y agoLately I've switched to the terms "check" and "fix" because more and more formatters (at least in my bubble of Python and Go) are incorporating fixes. So not just rearranging code and maybe adding a comma here and there.
- Narushia 1y agoI guess the line might feel fuzzy to some people, since nowadays many tools bundle both linting and formatting. And with modern IDE integrations, you might not even run them explicitly — the editor just does both automatically in one go.
- beaugunderson 1y agomany people use the prettier plugin for eslint, for example, so in that case they're one and the same!
- closeparen 1y agoBefore picking up Go with its formatter and format-on-save norm, I mostly worked in contexts where a program would scan your source code and complain about style violations, but not actually fix them. We called those linters.