-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dartanalyzer forces things like indents and spaces when reformatting afile. Should it use a preferences file for it? #261
Comments
<img src="https://avatars.githubusercontent.com/u/5840555?v=3" align="left" width="48" height="48"hspace="10"> Comment by bwilkerson Added Area-Formatter, Triaged labels. |
The main goal of the formatter is to make code more consistent from user to user. Configurability, while I understand why people want it, doesn't line up with that goal. Sorry. |
@munificent Some Organizations like to standardize on a specific formatting style. |
That's great! The best style for this is the one that everyone else is also using.
Not on the entire community, but on the subset of the community that choose to use the formatter... yes we can. :) The FAQ has some more details on why the formatter is written this way. |
@munificent |
Nooooo, 2 spaces is way better than 4. It allows to maximize the information density of code on the page, while still having enough white space that indentation is easily visible. I <3 the current style guide and its formatter. |
@a14n How can 'convenience' win over 'usability'? |
I'm not arguing for density over visibility. 2 spaces is imho a good balance between them. I use 4 spaces in my day to day job and 2 spaces on my free time job and I feel the code more readable with 2 spaces indent. But you're free to disagree ;) |
We have already standardized on two. Google has always used that for almost all of our languages, and much of the web ecosystem seems to have settled on two as well. Personally, I like four as well, but almost all Dart code used two, even before the formatter or style guide existed. |
As pointed out here dart-lang/dart_style#261, dartanalyzer only supports indentation using 2 spaces. This commit changes DartLintBear to check that ``use_spaces`` is True and ``indent_size`` is 2 and raises a ``ValueError`` if not. Fixes coala#897
Originally opened as dart-lang/sdk#23511
This issue was originally filed by [email protected]
What steps will clearly show the issue / need for enhancement?
What is the current output?
When formatting, dartanalyzer forces things like tab length to 2 and removes spaces on parenthesis and curly braces.
What would you like to see instead?
Since Dart Editor is going to dissapear, It'd be nice if dartanalyzer respect user preferences, maybe as flags or config files (maybe a analyzer.json?), when formatting code.
What version of the product are you using? On what operating system?
I'm using dart-sdk 1.10.0 on Windows 7.
Please provide any additional information below.
I opened a bug on dart-tools project which brings dart tools to atom users as an option to Java IDEs (radicaled/dart-tools#29).
Thanks in advance
The text was updated successfully, but these errors were encountered: