EditorConfig: Support trim_trailing_whitespace #5

Closed
opened 2025-08-27 11:32:30 +02:00 by BaumiCoder · 0 comments
Owner

Feature description

Support the trim_trailing_whitespace for the .editorconfig files:

  • lint: Check that the files has no trailing white spaces if the property is set to true
  • fix: Remove the trailing white spaces if the property is set to true.

When Reading and writing the files the charset and EndOfLine properties have to be respected. Especially, writing with the wrong settings maybe break the rules of the other properties in the files. See also #3 and #4. If these properties are not set, a suitable default has to be used (for EndOfLine maybe the system / OS default).

Benefits

To avoid trailing white spaces in all files, if the trim_trailing_whitespace property is set to true via .editorconfig.

Resources

### Feature description Support the `trim_trailing_whitespace` for the `.editorconfig` files: - lint: Check that the files has no trailing white spaces if the property is set to true - fix: Remove the trailing white spaces if the property is set to true. When Reading and writing the files the `charset` and `EndOfLine` properties have to be respected. Especially, writing with the wrong settings maybe break the rules of the other properties in the files. See also #3 and #4. If these properties are not set, a suitable default has to be used (for `EndOfLine` maybe the system / OS default). ### Benefits To avoid trailing white spaces in all files, if the `trim_trailing_whitespace` property is set to true via `.editorconfig`. ### Resources - [ec4rs](https://crates.io/crates/ec4rs) - Crate to access the EditorConfig properties of files - Documentation of the property - [in the crate](https://docs.rs/ec4rs/latest/ec4rs/property/enum.TrimTrailingWs.html) - [in the specification](https://spec.editorconfig.org/#supported-pairs)
BaumiCoder added reference feature/5-trim_trailing_whitespace 2026-05-04 15:16:56 +02:00
BaumiCoder 2026-05-05 19:32:13 +02:00
  • closed this issue
  • removed the
    WIP
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BaumiCoder/ecformat#5
No description provided.