Closed Y-Less closed 3 months ago
with all due respect, this is a code formatting tool. comments are designed to be interpreted by scaladoc generation tools.
personal suggestion: if you write multiple complex sentences in a comment, separate them into paragraphs. code comment is not a treatise, after all.
Except this tool already does touch and modify comments. If it completely ignored them that would be a reasonable solution, but it is removing the extra spaces so it already is doing this formatting in some way.
There should be a way to configure the number of spaces put after a full stop in comments.
Configuration (required)
Please paste the smallest possible set of
.scalafmt.conf
configuration parameters that reproduces the problem:Command-line parameters (required)
When I run scalafmt via CLI like this:
scalafmt-native
Steps
Given code like this:
Problem
Scalafmt formats code like this:
Expectation
I would like the formatted output to look like this:
Workaround
You can disable the formatting on the line, but I do like the mutli-line reflow ability for comments.
Notes
https://www.independent.co.uk/tech/one-space-or-two-spaces-after-a-full-stop-scientists-have-finally-found-the-answer-a8337646.html
Ignore the tag line, the conclusion is that two spaces are better, at least in fixed-width fonts as most code is.
Megan McArdle, via the linked article.