Skip to content

Don't force "format on save" setting on contributors #31

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

Merged
merged 1 commit into from
Jul 11, 2022
Merged

Don't force "format on save" setting on contributors #31

merged 1 commit into from
Jul 11, 2022

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Feb 4, 2022

The editor.formatOnSave VS Code setting controls whether file are automatically formatted when saved.

Checking a VS Code workspace settings configuration file into the repository with this setting enabled seems like it would increase the likelihood of contributions being properly formatted. Unfortunately, in this case it does just the opposite. The reason is that no formatter and configuration is provided, so VS Code formats the code according to
whatever formatter and configuration the contributor happens to have set up for TypeScript. In my case, that is Prettier, the default configuration of which causes extensive formatting changes on save.

This will result in the following scenarios:

  • Conscientious contributors waste time reverting unexpected diffs and figuring out how to prevent future such diffs
  • Other contributors submit low quality contributions
  • Maintainers waste time review contributions with large diffs unrelated to the proposal
  • Conscientious maintainers waste time cajoling contributors into removing unrelated changes from their contributions
  • Other maintainers allow large unrelated diffs to be introduced into the repository

Ideally, the infrastructure of the project would be set up to enforce standard code style compliance from contributions. But until that happens, it is best to remove this harmful setting.

The `editor.formatOnSave` VS Code setting controls whether file are automatically formatted when saved.

Checking a VS Code workspace settings configuration file into the repository with this setting enabled seems like it
would increase the likelihood of contributions being properly formatted. Unfortunately, in this case it does just the
opposite. The reason is that no formatter and configuration is provided, so VS Code formats the code according to
whatever formatter and configuration the contributor happens to have set up for TypeScript. In my case, that is
Prettier, the default configuration of which causes extensive formatting changes on save.

This will result in the following scenarios:

- Conscientious contributors waste time reverting unexpected diffs and figuring out how to prevent future ones
- Other contributors submit low quality contributions
- Maintainers waste time review contributions with large diffs unrelated to the proposal
- Conscientious maintainers waste time cajoling contributors into removing unrelated changes from their contributions
- Other maintainers allow large unrelated diffs to be introduced into the repository

Ideally, the infrastructure of the project would be set up to enforce standard code style compliance from contributions.
But until that happens, it is best to remove this harmful setting.
@per1234 per1234 added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Feb 4, 2022
@per1234 per1234 requested a review from AlbyIanna February 4, 2022 07:40
@per1234 per1234 self-assigned this Feb 4, 2022
@kittaakos kittaakos requested review from kittaakos July 11, 2022 15:55
Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it makes sense. Let's keep the dev experience of this repo close to the IDE2. Thank you!

@per1234 per1234 merged commit c810a04 into arduino:main Jul 11, 2022
@per1234 per1234 deleted the disable-format-on-save branch July 11, 2022 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants