Skip to content
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

Replace IDE 2.x configuration file content with link to source #418

Merged
merged 2 commits into from
Aug 1, 2022
Merged

Replace IDE 2.x configuration file content with link to source #418

merged 2 commits into from
Aug 1, 2022

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jul 26, 2022

Background

Arduino IDE 2.x allows the user to customize the output of the "Auto Format" feature via a configuration file.

This system is documented in the "Customizing the Auto Formatter Feature" tutorial.

When the user customizes the formatter, their configuration file is used exclusively by the formatter tool rather than being merged into the standard configuration. Since the user is likely only interested in modifying a small number of specific aspect of the standard configuration (e.g., wishing to use "broken" rather than "attached" braces), they will find it convenient to use Arduino's standard configuration as a base for their custom configuration. For this reason, the standard configuration is offered in the tutorial.

Previously, the full YAML code of the standard configuration was included in the tutorial page itself. This was the best approach at the time the tutorial was created because what was the canonical source in the Arduino IDE code base is in a format not usable in this application.

Since that time, the ClangFormat native YAML file has been published in a dedicated permanent location where it is hosted as the canonical source for all projects that use the configuration (arduino/tooling-project-assets#250).

What This PR Changes

This pull request proposes the removal the configuration code from the tutorial, replaced by a link to the source file.

This change would provide the following benefits:

Reduce maintenance burden

The configuration code must be updated periodically in parallel to bumps of the version of ClangFormat used by Arduino IDE 2.x and other Arduino development tools.

This is handled as a matter of course in the canonical source file, but the copy hosted in the tutorial content would have needed updates as well (or else become outdated).

Pointing the reader to the source ensures they will always have the current configuration without any need to maintain the documentation content.

Improves approachability of tutorial

The configuration code added a large block of complex YAML to the tutorial. Although it will be necessary for the reader to eventually work with this code, they don't have any need to browse through it while reading the tutorial. So having the code as part of the tutorial content didn't add anything of value and also harmed the readability.

Contribution Guidelines

Arduino IDE 2.x allows the user to customize the output of the "Auto Format" feature via a configuration file.

This system is documented in the "Customizing the Auto Formatter Feature" tutorial.

When the user customizes the formatter, their configuration file is used exclusively by the formatter tool rather than
being merged into the standard configuration. Since the user is likely only interested in modifying a small number of
specific aspect of the standard configuration (e.g., wishing to use "broken" rather than "attached" braces), they will
find it convenient to use Arduino's standard configuration as a base for their custom configuration. For this reason,
the standard configuration is offered in the tutorial.

Previously, the full YAML code of the standard configuration was included in the tutorial page itself. This was the best
approach at the time the tutorial was created because what was the canonical source in the Arduino IDE code base is in a
format not usable in this application.

Since that time, the ClangFormat native YAML file has been published in a dedicated permanent location where it is
hosted as the canonical source for all projects that use the configuration. This enabled the removal of the
configuration code from the tutorial, replaced by a link to the source file.

This change provides the following benefits:

### Reduce maintenance burden

The configuration code must be updated periodically in parallel to bumps of the version of ClangFormat used by Arduino
IDE 2.x and other Arduino development tools.

This is handled as a matter of course in the canonical source file, but the copy hosted in the tutorial content would
have needed updates as well (or else become outdated).

Pointing the reader to the source ensures they will always have the current configuration without any need to maintain
the documentation content.

### Improves approachability of tutorial

The configuration code added a large block of complex YAML to the tutorial. Although it will be necessary for the reader
to eventually work with this code, they don't have any need to browse through it while reading the tutorial. So having
the code as part of the tutorial content didn't add anything of value and also harmed the readability.
Arduino IDE 2.x allows the user to customize the output of the "Auto Format" feature via a configuration file. This
system is documented in the "Customizing the Auto Formatter Feature" tutorial.

Arduino's standard formatter configuration file is offered as part of the tutorial. Originally, the full YAML code of
the standard configuration was included in the tutorial page itself. Since that consisted as a large block of cryptic
code, it made sense to place it at the bottom of that section of the tutorial, after the section's prose content, following this structure:

- Introduction
- Supplemental note
- Configuration code

Since that time, the code content has been replaced by a link to the source file. After this change, the placement of
this essential link (which is less visibly prominent in the page) makes less sense. The content will be easier to follow
with the new structure:

- Introduction
- Configuration file link
- Supplemental note
@per1234 per1234 added enhancement New feature or request arduino Bugs and fixes added by the Arduino Team labels Jul 26, 2022
Copy link
Contributor

@BenjaminDannegard BenjaminDannegard left a comment

Choose a reason for hiding this comment

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

LGTM

@per1234 per1234 merged commit e82e1b8 into arduino:main Aug 1, 2022
Serjlee pushed a commit that referenced this pull request Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arduino Bugs and fixes added by the Arduino Team enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants