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

Sync sketch formatter configuration from source #133

Merged
merged 1 commit into from
Aug 5, 2022
Merged

Sync sketch formatter configuration from source #133

merged 1 commit into from
Aug 5, 2022

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Aug 4, 2022

Arduino Language Server's embedded ClangFormat configuration is designed to produce the standard Arduino sketch formatting style, as established by the Arduino IDE 1.x formatter.

The configuration is consumed by several other projects. In order to provide all the consumers with a single canonical source and to locate the infrastructure and activity related to the maintenance of the file in a more appropriate repository, it is now hosted in a permanent location in the arduino/tooling-project-assets repository:

https://github.com/arduino/tooling-project-assets/tree/main/other/clang-format-configuration

The following changes have been made to the source configuration:

  • Move documentation comments to a dedicated file in the upstream repository (which is accessible via the URL in the comment at the top of the configuration)
  • Make additional non-functional changes to the configuration format to facilitate maintenance
  • Update to use the configuration API of ClangFormat 14.0.0

This last item did result in some functional changes to the configuration which will result in minor differences in the formatter output.

These are actually reversions of unwanted differences from the Arduino IDE 1.x formatter output, which were unavoidable when using the 11.0.1 version of ClangFormat in use at the time of the configuration's creation. The default output of the Arduino IDE 1.x formatter will continue to be considered the "gold standard" until Arduino IDE 2.x graduates from "pre-release" status, at which time its output (which is produced via the same configuration) will become the new standard.

The Arduino Language Server supports overriding the embedded default configuration with user provided configuration files. Those already using custom configurations will not be affected in any way (though they are encouraged to sync their configuration files from the source to bring them into compliance with the configuration API of the clangd version 14.0.0 Arduino Language Server is intended to be used with).

See the documentation and commit history of the source file for details on the configuration changes:

https://github.com/arduino/tooling-project-assets/tree/main/other/clang-format-configuration


Related: arduino/arduino-ide#1285

The Arduino Language Server's embedded ClangFormat configuration is designed to produce the standard Arduino sketch
formatting style, as established by the Arduino IDE 1.x formatter.

The configuration is consumed by several other projects. In order to provide all the consumers with a single canonical
source and to locate the infrastructure and activity related to the maintenance of the file in a more appropriate
repository, it is now hosted in a permanent location in the arduino/tooling-project-assets repository.

The following changes have been made to the source configuration:

- Move documentation comments to a dedicated file in the upstream repository (which is accessible via the URL in the
  comment at the top of the configuration)
- Make additional non-functional changes to the configuration format to facilitate maintenance
- Update to use the configuration API of ClangFormat 14.0.0

This last item did result in some functional changes to the configuration which will result in minor differences in the
formatter output.

These are actually reversions of unwanted differences from the Arduino IDE 1.x formatter output, which were unavoidable
when using the 11.0.1 version of ClangFormat in use at the time of the configuration's creation. The default output of
the Arduino IDE 1.x formatter will continue to be considered the "gold standard" until Arduino IDE 2.x graduates from
"pre-release" status, at which time its output (which is produced via the same configuration) will become the new
standard.

The Arduino Language Server formatter configuration is fully customizable according to the preferences of each user.
Those already using custom configurations will not be affected in any way (though they are encouraged to sync their
configuration files from the source to bring them into compliance with the configuration API of the clangd version
14.0.0 Arduino Language Server is intended to be used with).

See the documentation and commit history for the source file for details on the configuration changes:

https://github.com/arduino/tooling-project-assets/tree/main/other/clang-format-configuration
@per1234 per1234 added the type: enhancement Proposed improvement label Aug 4, 2022
@per1234 per1234 requested a review from cmaglie August 4, 2022 18:55
@per1234 per1234 self-assigned this Aug 4, 2022
@per1234 per1234 merged commit af4668b into arduino:main Aug 5, 2022
@per1234 per1234 deleted the update-clang-format-config branch August 5, 2022 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants