Skip to content

Disable vscode autoformatting #229

Closed

Description

@gnprice

We've had a couple of contributors who use Visual Studio Code, and were frustrated by its eagerness to reformat entire files:

It should be possible to supply project-level config to VS Code to tell it not to do that, and we should put that config in the repo.

The PR #155 included a draft of such a config, which can be a starting point.

Activity

  1. added
    a-toolsOur own development tooling, scripts, and infrastructure
    on Jul 19, 2023
  2. added this to the Alpha milestone on Jul 19, 2023
  3. self-assigned this
    on Jul 19, 2023
  4. onli commented on Jul 19, 2023

    @onli

    A suggestion: The ideal solution would be not to disable the formating completely, but to let that IDE autoformat it in an acceptable way. I'm actually surprised that there is a format conflict here, doesn't VSCode with the flutter plugin just call dartfmt, and wouldn't dartfmts default be the best code style for this flutter project?

  5. gnprice commented on Jul 19, 2023

    @gnprice
    MemberAuthor

    Yeah. We don't use dartfmt, and instead use a style similar to what's in the Flutter repo itself:
    https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#formatting

    Our experience has been that

    • there are several recurring ways in which dartfmt tends to make the code harder to read than it would be if formatted better;
    • and at least for me, when using dartfmt / dart format, it hasn't felt to me like it means not thinking about formatting, more like doing different thinking about formatting.

    Discussion with more details here:
    https://chat.zulip.org/#narrow/stream/48-mobile/topic/Dart.20formatting/near/1585603
    There's also a bit further context in:

    The Flutter folks would like to use autoformatting too, and have had discussions for years with the Dart folks about making dartfmt work well for the Flutter style. I recently saw a mention that there might be progress happening on that, which would be great.

  6. added a commit that references this issue on Jul 19, 2023
    7dd4721
  7. added a commit that references this issue on Jul 20, 2023
    2da776d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a-toolsOur own development tooling, scripts, and infrastructure

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions