standardrb / standard

Ruby's bikeshed-proof linter and formatter 🚲
Other
2.73k stars 214 forks source link

Line length? #648

Closed pierry01 closed 2 months ago

pierry01 commented 2 months ago

Limit line length to 120 · Shopify/vscode-ruby-lsp@85740fa https://github.com/Shopify/vscode-ruby-lsp/commit/85740fab7523dc42f6f19a309c0e2124a0aece16

I got your reasons, but it definitely should be configurable image

There's a lot of articles on the internet mentioning that 120 characters is a good place to start image

Between freestyle vs 120 characters, I guess 120 characters + configurable is the way!

searls commented 2 months ago

Rubocop's entire Metric department is intentionally disabled by Standard and for reasons that are so steeped in the basic principle of "never enable a rule that can't be adhered to in all reasonable cases". There are always going to be reasonable exceptional cases to long lines, so turning on any metric (line length, method length, etc) would just invite issues offering contradictory evidence (e.g. "See this code? I need 148 chars!")

We're also never going to introduce configuration like this, because then Standard's formatting behavior would differ between projects, which would undermine the project's namesake.

If you want this kind of qualitative code quality stuff, I suggest looking at a tool designed specifically at measuring quality and that is equipped to do so on a deeper level, like Reek or its family of friends