You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pekko.apache.org by GitBox <gi...@apache.org> on 2022/11/03 06:42:44 UTC

[GitHub] [incubator-pekko] alexandru commented on a diff in pull request #2: Update and apply scalafmt

alexandru commented on code in PR #2:
URL: https://github.com/apache/incubator-pekko/pull/2#discussion_r1012542641


##########
.scalafmt.conf:
##########
@@ -1,21 +1,52 @@
-version = 2.1.0
-
-style = defaultWithAlign
-
-docstrings                 = JavaDoc
-indentOperator             = spray
-maxColumn                  = 120
-lineEndings                = preserve
-rewrite.rules              = [RedundantParens, SortImports, AvoidInfix]
-unindentTopLevelOperators  = true
-align.tokens               = [{code = "=>", owner = "Case"}]
-align.openParenDefnSite    = false
-align.openParenCallSite    = false
-optIn.breakChainOnFirstMethodDot = false
-optIn.configStyleArguments = false
-danglingParentheses = false
-spaces.inImportCurlyBraces = true
-rewrite.neverInfix.excludeFilters = [
+version                                  = 3.6.1
+runner.dialect                           = scala213
+project.git                              = true
+style                                    = defaultWithAlign
+docstrings.style                         = Asterisk
+docstrings.wrap                          = false
+indentOperator.preset                    = spray
+maxColumn                                = 120

Review Comment:
   I'm not working on a ultra-wide monitor, I work on a 16-inch MacBook, and before that, I worked on a 13-inch MacBook. I also keep my font at 16, because when reading code, the presentation quality is better than quantity.  180 chars would not fit on any screen I worked on in the past 10 years 🙂
   
   Also, I'd argue that having to move your eyes from left to right for 180 chars can be terrible for readability. The consensus is that continuous lines have to be under 80 chars for the best results, a claim somewhat corroborated by at least one study I saw. Of course, in programming we also have indentation, but if you have that much indentation to need more than 120 chars, maybe that code is a little too complex in terms of branching.
   
   If you have a wide-monitor, a better use of that space is to open 2 files side by side (e.g., in diffs), which is also good for PR reviews.
   
   Personally I'd go with 100. The only reasons for why I don't like that is because Scala's function signatures can get awkwardly long, and formatting those signatures becomes a chore. I'd wish, however, for Scalafmt to have different settings depending on context — e.g., leave the function signatures on one line, but anything after the `=` hard-wrap it at 100.
   
   Going with something more than 120, for me, it's like not having any limits at all. Which is fine, but then I personally complain about code not being readable in code reviews, and we desperately want to avoid that. Which is the value that Scalafmt brings.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pekko.apache.org
For additional commands, e-mail: dev-help@pekko.apache.org